Skip to content

Allow for arbitrary species identifiers. Add Python 3 FortFlex module.#23

Open
mkrupcale wants to merge 1 commit into
spectraphilic:masterfrom
mkrupcale:arbitrary-species-ids
Open

Allow for arbitrary species identifiers. Add Python 3 FortFlex module.#23
mkrupcale wants to merge 1 commit into
spectraphilic:masterfrom
mkrupcale:arbitrary-species-ids

Conversation

@mkrupcale
Copy link
Copy Markdown

  • .gitignore: Ignore .cache from Python tests and FortFlex extension modules
  • reflexible/conv2netcdf4/flexpart_read.py: Extract the species identifiers metadata from the RELEASES file
  • reflexible/conv2netcdf4/fortflex/build_FortFlex.sh: Remove signature file after invoking f2py rather than before so it doesn't accidentally get checked into repo
  • reflexible/conv2netcdf4/fortflex/build_FortFlex_py3.sh: Add Python 3 FortFlex module builder
  • reflexible/conv2netcdf4/grid_read.py: Accept type np.int64 in instance comparisons for nspec_ret, time_ret and nspec
  • reflexible/conv2netcdf4/tests/test_netcdf4_structure.py: Make the range call a little more succinct
  • reflexible/flexpart.py: Use the species identifiers in reading the species files
  • reflexible/scripts/create_ncfile.py: Use the species identifiers in reading the species files
  • reflexible/tests/test_flexpart.py: Update release tests to account for new dictionary structure separating release data and metadata (i.e. species IDs)
  • reflexible/tests/test_flexpart.py: Update species tests to more thoroughly test species parameters

* .gitignore: Ignore .cache from Python tests and FortFlex extension modules
* reflexible/conv2netcdf4/flexpart_read.py: Extract the species identifiers metadata from the RELEASES file
* reflexible/conv2netcdf4/fortflex/build_FortFlex.sh: Remove signature file after invoking f2py rather than before so it doesn't accidentally get checked into repo
* reflexible/conv2netcdf4/fortflex/build_FortFlex_py3.sh: Add Python 3 FortFlex module builder
* reflexible/conv2netcdf4/grid_read.py: Accept type np.int64 in instance comparisons for nspec_ret, time_ret and nspec
* reflexible/conv2netcdf4/tests/test_netcdf4_structure.py: Make the range call a little more succinct
* reflexible/flexpart.py: Use the species identifiers in reading the species files
* reflexible/scripts/create_ncfile.py: Use the species identifiers in reading the species files
* reflexible/tests/test_flexpart.py: Update release tests to account for new dictionary structure separating release data and metadata (i.e. species IDs)
* reflexible/tests/test_flexpart.py: Update species tests to more thoroughly test species parameters
@coveralls
Copy link
Copy Markdown

Coverage Status

Coverage increased (+0.3%) to 53.989% when pulling b7116e4 on mkrupcale:arbitrary-species-ids into 0a24fb9 on spectraphilic:master.

#!/bin/bash

f2py3 -m FortFlex -h FortFlex.pyf FortFlex.f
f2py3 -c --fcompiler=gfortran FortFlex.pyf FortFlex.f
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't have f2py3 here, using conda I have f2py3.6 which is identical to f2py.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Based on upstream, the only difference between f2py and f2py3 besides their name is which python interpreter executes them (i.e. Python 2 vs. Python 3). Now different distributions will have different interpreter names (in fact, python which produces f2py could even be a Python 3 interpreter), and I don't expect this to work for all distributions, but I believe that python3 (which produces f2py3) is somewhat standard for generic Python 3. An alternative would be to invoke f2py explicitly using the Python 3 interpreter, but this is inconsistent with the other FortFlex build script and requires some guessing or searching for the name of the Python 3 interpreter (no different than guessing the name of f2py).

The user is of course not required to use this script to build the Python 3 FortFlex module, but I think this is probably generic enough to work for most users.

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.

3 participants