Skip to content

Add Python 3.8, 3.9 to testing matrix#993

Merged
dwhswenson merged 7 commits into
openpathsampling:masterfrom
dwhswenson:py39
Apr 8, 2021
Merged

Add Python 3.8, 3.9 to testing matrix#993
dwhswenson merged 7 commits into
openpathsampling:masterfrom
dwhswenson:py39

Conversation

@dwhswenson

@dwhswenson dwhswenson commented Mar 14, 2021

Copy link
Copy Markdown
Member

OpenMM and OpenMMTools are now available on conda-forge (and therefore available for Python > 3.7). Resolves #864.

Because we release via conda-forge, we already release on 3.8 and 3.9, but they haven't been in our test matrix on CI.

@dwhswenson

Copy link
Copy Markdown
Member Author

I suspect that the current failure is due to something changing in Python internals that breaks OPS storage between different versions. Most likely, a change in bytecode. OPS stores the bytecode of CVs, and bytecode can change between Python minor versions. This means that files should only be opened with the same version of Python (or need to be opened in safe mode). We had to make a change based on this when Python 3.6 came out.

@sroet

sroet commented Mar 14, 2021

Copy link
Copy Markdown
Member

from looking at examples/ipynbtests.sh
it might be as easy as making another couple lines in:

case $PYTHON_VERSION in
    "2.7")
        mstis=$dropbox_base_url/1x4ny0c93gvu54n/toy_mstis_1k_OPS1.nc
        mistis=$dropbox_base_url/qaeczkugwxkrdfy/toy_mistis_1k_OPS1.nc
        ;;
    "3.6")
        mstis=$dropbox_base_url/1ulzssv5p4lr61f/toy_mstis_1k_OPS1_py36.nc
        mistis=$dropbox_base_url/76981cbgxm639m3/toy_mistis_1k_OPS1_py36.nc
        ;;
    "3.7")
        mstis=$dropbox_base_url/1ulzssv5p4lr61f/toy_mstis_1k_OPS1_py36.nc
        mistis=$dropbox_base_url/76981cbgxm639m3/toy_mistis_1k_OPS1_py36.nc
        ;;
    *)
        echo "Unsupported Python version: $PYTHON_VERSION"
esac

(As 3.6 and 3.7 already are identical?)

@sroet

sroet commented Mar 14, 2021

Copy link
Copy Markdown
Member

(if that is the case, please also make a note in .github/workflows/tests.yml to remind future developers to add these whenever the testing matrix is changed)

@dwhswenson

Copy link
Copy Markdown
Member Author

@sroet : Yes, that's pretty much it. Basically, I think all I need to do is re-run the example in each version of Python, and then save the file with 1000 MC steps (which should be enough that TIS analysis has enough overlap), stick that in my Dropbox, and update with the appropriate links.

Adding a comment to the CI yml is a good idea. It isn't that you necessarily need to do this every time (the file from 3.6 also works with 3.7), but it is a problem that can occur and should be straightforward to fix when it comes up.

Probably won't get to that today, though.

@sroet sroet mentioned this pull request Mar 14, 2021
@codecov

codecov Bot commented Apr 6, 2021

Copy link
Copy Markdown

Codecov Report

Merging #993 (b9c1c89) into master (5f86032) will increase coverage by 0.52%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #993      +/-   ##
==========================================
+ Coverage   80.62%   81.15%   +0.52%     
==========================================
  Files         138      138              
  Lines       14695    15118     +423     
==========================================
+ Hits        11848    12269     +421     
- Misses       2847     2849       +2     
Impacted Files Coverage Δ
openpathsampling/deprecations.py 100.00% <0.00%> (ø)
openpathsampling/analysis/tis/core.py 100.00% <0.00%> (ø)
openpathsampling/analysis/tis/flux.py 100.00% <0.00%> (ø)
openpathsampling/snapshot_modifier.py 100.00% <0.00%> (ø)
openpathsampling/analysis/channel_analysis.py 100.00% <0.00%> (ø)
openpathsampling/ensembles/visit_all_states.py 100.00% <0.00%> (ø)
openpathsampling/pathmovers/spring_shooting.py 100.00% <0.00%> (ø)
openpathsampling/pathsimulators/reactive_flux.py 100.00% <0.00%> (ø)
openpathsampling/high_level/ms_outer_interface.py 100.00% <0.00%> (ø)
openpathsampling/analysis/tis/standard_analysis.py 100.00% <0.00%> (ø)
... and 67 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5f86032...b9c1c89. Read the comment docs.

@dwhswenson

Copy link
Copy Markdown
Member Author

Summary of changes here:

  • Added 3.8 and 3.9 to the testing matrix (including adding new example data files based on 3.8)
  • Added script examples/prep_example_data.py to create data for analysis. It turns out that our old setups used a version of the examples that started with trajectories that met the requirements for the outermost ensembles. This ensured overlap in the TIS analysis, but this approach has long since been removed from the actual examples. The actual examples need more than 1000 steps to get overlap for TIS analysis. This new script sets things up using the old approach (and even figures out the Python version and labels the output file correctly).
  • Changed tutorial_storage.ipynb to load CV by name, not number. The datafiles we have now seem to go back to before we had "CVs" that take trajectories as input. storage.cv[0] in current files is a trajectory CV giving the maximum value of an order parameter over the trajectory. This does not give a list for output, which caused issues in the notebook.
  • Minor change to matrix so that minimal build shows in GitHub as "(3.7, minimal)" instead of "(3.7, true)".
  • Removed omnia from channels
  • Updated trove classifiers to match our tested versions

@dwhswenson

Copy link
Copy Markdown
Member Author

This is ready for review and comment. I will leave it open for at least 24 hours, merging no earlier than Wed 07 Apr 20:00 GMT (22:00 local).

@sroet sroet left a comment

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.

LGTM, thanks for adding the data-generation script!

@dwhswenson dwhswenson mentioned this pull request Apr 7, 2021
@dwhswenson dwhswenson merged commit bbff299 into openpathsampling:master Apr 8, 2021
@dwhswenson dwhswenson deleted the py39 branch April 8, 2021 07:44
@dwhswenson dwhswenson mentioned this pull request Jul 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Python 3.8 testing plans

2 participants