Convert geometric_features to python package with python 3 support#102
Convert geometric_features to python package with python 3 support#102xylar merged 23 commits intoMPAS-Dev:masterfrom
Conversation
This comment has been minimized.
This comment has been minimized.
b5c11b2 to
82db0ca
Compare
|
I have a corresponding branch here: xylar/MPAS-Model/update_geometric_features_api where I have updated the new I tested it out and it should work once |
|
To test the conda package, you can do: (You could use python 2.7 if you prefer). You should then be able to download one of the example scripts anywhere you like and run it without having to checkout the |
More is needed because of python 3
The same should apply here, since this was developed for MPAS-Model and is used in the COMPASS infrastructure of MPAS-Model to create test cases.
This new package has all the functionality of the top-level scripts and helpers but requires less code to do it and can be called from within other python code.
This keeps the reference data more clearly separate from other contents of the repository.
These are replaced by the new package
With the new infrastructure, these will hopefully not be used directly in anyone's workflow.
The default branch to check out geometric features from is the tag matching the version number of the code.
82db0ca to
a6e9204
Compare
@mark-petersen, This will not work without changes to COMPASS, as indicated above (#102 (comment)). I don't think we intend to modify the existing global ocean test cases to work with this version of geometric features. So this would require developing a new test suite for the non-V1 test cases. Essentially, this is a first step toward dropping v1 test cases from COMPASS and moving in a new, more coordinated direction. Maybe you and I should have a phone call about this. I'm not sure I have time today, though. |
|
Thanks, @milenaveneziani. Adding some new regions would indeed be a good way to test this. No big rush, just wanted to make sure this doesn't get abandoned entirely. |
|
I see. But I could test a single global_ocean case (not a suite) with your branch |
|
@mark-petersen, close. You could test the If you're testing this on IC, it's slightly painful to install Miniconda so you can create your own python environments (because of the firewall) but I could work you through it. |
|
@xylar so far so good - on IC in my own conda directory, I was able to use your commands in #102 (comment) to create and activate the compass conda environment. Could you rebase xylar/MPAS-Model/update_geometric_features_api onto ocean/develop? There are some conflicts with that compass update. Using python 3, it still gets stuck on print statements. Using python 2 it hangs at I'm not sure if that needs to be added to the environment, or done a different way in MPAS-Tools. Commenting out the vtk line, I was able to get to work completely. I then tried on a compute node. On a log-in node, it is Is that a directory from this repo. So I used git to download this repo by hand and made a soft link. It runs which is linked to the current head of MPAS-Tools. Is that supposed to be replaced with an internal python call? |
|
@mark-petersen, thanks for all that testing! It looks like a lot has happened in 2 months that means I need to clean things up. I'll do that and ask you to give things another try soon. Sorry you struggled but this is all really helpful to me! |
|
@xylar no problem at all. I only spent 15 minutes, and a little problem-solving is good for me. |
|
@sbrus89, @xylar is making a python package for COMPASS. What special python libraries are you using for your coastal setup? We should include them here. LIGHT uses |
|
@mark-petersen, @sbrus89 is on vacation-- I know he is using pyflann for instance. But, there are probably others too. |
|
Don't worry too much. I'll figure these out as I test. |
cde9dee to
68e9bee
Compare
|
@mark-petersen, I've made some headway on getting things back up and working. However, I discovered this issue in the process: I also found some incompatibilities with python 3 in the COMPASS framework, see MPAS-Dev/MPAS-Model#222 Please create a new conda environment like this: conda create -n compass_py3.7 -c conda-forge -c xylar python=3.7 geometric_features mpas_tools \
jigsaw metis pyflann scikit-image basemap
conda activate compass_py3.7Please clone cd jigsaw-geo-matlab/jigsaw/bin/LNX-64/
which jigsaw
ln -sfn <path/to/jigsaw> jigsaw64rwhere Checkout my branch My A goal is to eliminate as any executables and paths as possible, but particularly all references to Other test cases outside of the nightly regression suite also need attention, so we're not ready to merge yet but I want to make sure you can get this far. I also tested the QU240 init test case with python 2.7, so you can try as above but changing 3.7 to 2.7, but the priority is making sure python 3 is supported. (You can use the same |
|
So the feature where this package downloads the |
|
@mark-petersen, the temporary fix (mentioned above) to jigsaw-geo-matlab should no longer be necessary if you update to the latest version. |
mark-petersen
left a comment
There was a problem hiding this comment.
Tested compass_py3.7 package and this PR and successfully on grizzly and badger, compute node and front end node (except mpirun calls). Tested QU240 init, QU240 test, EC60to30 init.
|
Great! I'm going to remove a commit where I point to a temporary branch and then merge this PR. |
…s' into ocean/develop A large number of updates to the COMPASS ocean API including: - using the geometric_features conda package (MPAS-Dev/geometric_features#102) - using the mpas_tools conda package (MPAS-Dev/MPAS-Tools#248) - updating the jigsaw_to_MPAS scripts to work as a python package and to support python 3 - update global_ocean scripts to python 3 and to use these new packages NOTE: This merge removes the capability to create the global meshes used in E3SM version 1, (2017-2018), where the base meshes were created with Doug Jacobsen’s tool. The global mesh creation remaining after this commit only uses the Jigsaw tool. In order to recreate meshes and initial conditions used in E3SM version 1, use repositories as of March 1, 2019: 1. MPAS-Model commit:42029f218175d893cf25e19a26d9b43382a44d54 2. MPAS-Tools commit:6d0fa3a24e879a1a5b6149d9fbfe80fa021489dc 3. geometric_features tag:E3SMv3grids 76709be closes #220 closes #213 closes #132 closes #166
…esh_tools' into ocean/develop A large number of updates to the COMPASS ocean API including: - using the geometric_features conda package (MPAS-Dev/geometric_features#102) - using the mpas_tools conda package (MPAS-Dev/MPAS-Tools#248) - updating the jigsaw_to_MPAS scripts to work as a python package and to support python 3 - update global_ocean scripts to python 3 and to use these new packages NOTE: This merge removes the capability to create the global meshes used in E3SM version 1, (2017-2018), where the base meshes were created with Doug Jacobsen’s tool. The global mesh creation remaining after this commit only uses the Jigsaw tool. In order to recreate meshes and initial conditions used in E3SM version 1, use repositories as of March 1, 2019: 1. MPAS-Model commit:42029f218175d893cf25e19a26d9b43382a44d54 2. MPAS-Tools commit:6d0fa3a24e879a1a5b6149d9fbfe80fa021489dc 3. geometric_features tag:E3SMv3grids 76709be closes MPAS-Dev#220 closes MPAS-Dev#213 closes MPAS-Dev#132 closes MPAS-Dev#166
This PR represents my proposal for a rather big change to
geometric_features. It includes:geometry_datafor clarity and separation from the codedriver_scriptstoexamples(since they rarely get used as "drivers")The existing example scripts, the README.md, the one unit test we currently have, and CI have all been updated to work with the new interface.
The purpose of this work is:
closes #101
closes #96