Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate to Cython 3 #1639

Merged
merged 24 commits into from
Jun 24, 2023
Merged

Migrate to Cython 3 #1639

merged 24 commits into from
Jun 24, 2023

Conversation

mcflugen
Copy link
Member

@mcflugen mcflugen commented Jun 13, 2023

Description

This pull request is an attempt to migrate to Cython 3.

Highlights:

  • Changed the build-system (in pyproject.toml) to use cython version 3.0.0b3 or greater. It seems to have some improvements we could use and, I believe, @sebastien-lenard was wanting to use some of that new functionality in his new routing components.
  • cythonized (and parallelized using openmp) functions that calculate gradients, and divergence on raster grids.
  • Added some (speed) benchmarks for the new cythonized code.
  • Added -fopenmp to the compile options. Note that this this is only added if the WITH_OPENMP environment variable is set. I did this because the default compilers on Mac and Windows do not come with openmp. To use openmp on Mac, I use the conda compilers (I imagine use Homebrew would also work).

@gregtucker and/or @sebastien-lenard maybe you could give this a review?

Checklist - did you ...

  • Add a news fragment file entry if necessary?
  • Add / update tests if necessary?
  • Add new / update outdated documentation?
  • All tests have passed?
  • Formatted code with black?
  • Removed lint reported by flake8?
  • Sucessful documentation built? (if documentation added or modified)

@mcflugen mcflugen marked this pull request as draft June 14, 2023 20:45
@mcflugen mcflugen marked this pull request as ready for review June 16, 2023 20:34
@gregtucker
Copy link
Contributor

Looks good to me. Great that you were able to squeeze some speed out!

@mcflugen mcflugen merged commit 0b56840 into master Jun 24, 2023
@mcflugen mcflugen deleted the mcflugen/migrate-to-cython-3 branch June 24, 2023 02:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants