Skip to content

Commit

Permalink
Add a new file to set the python environment for conda
Browse files Browse the repository at this point in the history
  • Loading branch information
ekluzek committed May 9, 2022
1 parent da5a015 commit 7e29778
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 2 deletions.
21 changes: 19 additions & 2 deletions python/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,16 @@
To run all tests (unit tests, system tests and pylint), simply run `make
all` from this directory.

## Python environment

One way to get a python environment for this to work together on cheyenne is to use

ncar\_pylib

Another way is to use the file conda\_env\_ctsm\_py.txt to setup
a python environment. Comments in the file tell how to do this
on cheyenne.

## Unit and system tests

Unit and system tests can be run in one of two ways; these do the same
Expand All @@ -31,5 +41,12 @@ thing, but support different options:

You can run pylint on everything in the ctsm package with `make lint`.

Note: you should expect some errors if using a python2 version of
pylint, but this should be clean if running with a python3 version.
Note, that the listing of errors with pylint is very specific to the version
of pylint being used. Using a python environment as detailed earlier is important
in order to get a clean run of pylint.

## black

You can run a check for the black formatting with `make black`.
This won't change the code, but check if it would be reformatted
with black.
11 changes: 11 additions & 0 deletions python/conda_env_ctsm_py.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# To install this on cheyenne with conda loaded in modules
# conda create -n ctsm_py # Do this one time
# conda install -n ctsm_py --file conda_env_ctsm_py.txt
python=3.7.9
scipy
netcdf4
requests
numpy=1.18.5
xarray=0.16.2
pylint=2.6.0
black=22.3.0

0 comments on commit 7e29778

Please sign in to comment.