Skip to content

Commit fadbf53

Browse files
authored
Split environment file (#79)
* Remove pre-commit hook * Remove packages not available on Windows * Make environment update file * Update name of Anaconda distribution * Update environment install and update instructions
1 parent 984762c commit fadbf53

File tree

4 files changed

+44
-24
lines changed

4 files changed

+44
-24
lines changed

.pre-commit-config.yaml

Lines changed: 0 additions & 6 deletions
This file was deleted.

environment.unix.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# An update to the `ivy` environment that includes packages not available
2+
# on Windows. The `ivy` environment must exist.
3+
#
4+
# See https://stackoverflow.com/a/43873901/1563298
5+
#
6+
# Usage:
7+
# $ conda env update --name ivy --file environment.unix.yaml --prune
8+
9+
channels:
10+
- conda-forge
11+
dependencies:
12+
- pymt_cem
13+
- pymt_sedflux

environment.yaml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
1-
# A conda environment for CSDMS Ivy lessons.
1+
# A conda environment file for the CSDMS Ivy lessons.
2+
#
3+
# This file is used to create the `ivy` environment on Linux, macOS, and
4+
# Windows. See "environment.unix.yaml" for additional packages that aren't
5+
# available on Windows.
26
#
37
# Usage:
4-
# $ conda env create --file=environment.yaml
5-
# $ source activate ivy
8+
# $ conda env create --file environment.yaml
9+
# $ conda activate ivy
610

711
name: ivy
812
channels:
@@ -24,9 +28,6 @@ dependencies:
2428
- terrainbento
2529
- pymt_child
2630
- pymt_hydrotrend
27-
- pymt_sedflux # [unix]
2831
- bmi-topography
2932
- imageio
3033
- tqdm
31-
- jupytext
32-
- pre-commit

lessons/conda/index.md

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,19 @@
22

33
# Anaconda and conda
44

5-
One attribute of Python that makes it a great language for science
5+
One feature of Python that makes it a great language for science
66
is its abundance of packages (numpy! scipy! pandas! xarray! pymt!).
77
Package management can be difficult, though,
88
especially when a typical Python installation contains dozens of packages.
99

1010
This is where the `conda` *package manager* is handy,
1111
and a primary reason why CSDMS uses (and we recommend)
12-
the Anaconda Python distribution
13-
(now called [Anaconda Individual Edition](https://www.anaconda.com/products/individual)).
12+
the [Anaconda Distribution](https://www.anaconda.com/products/distribution).
1413

1514
With `conda`, you can:
1615

17-
* list
1816
* install
17+
* list
1918
* update
2019
* remove
2120

@@ -45,11 +44,15 @@ change to this directory and view the file **environment.yaml** with `cat`:
4544
```
4645
$ cd ~/Desktop/ivy-main
4746
$ cat environment.yaml
48-
# A conda environment for CSDMS Ivy lessons.
47+
# A conda environment file for the CSDMS Ivy lessons.
48+
#
49+
# This file is used to create the `ivy` environment on Linux, macOS, and
50+
# Windows. See "environment.unix.yaml" for additional packages that aren't
51+
# available on Windows.
4952
#
5053
# Usage:
51-
# $ conda env create --file=environment.yaml
52-
# $ source activate ivy
54+
# $ conda env create --file environment.yaml
55+
# $ conda activate ivy
5356
5457
name: ivy
5558
channels:
@@ -65,25 +68,25 @@ dependencies:
6568
- pytest
6669
- coverage
6770
- bmipy
68-
- pymt >=1.1
69-
- landlab >=2.0
71+
# - bmi-example-python
72+
- pymt >=1.3
73+
- landlab >=2.5
7074
- terrainbento
7175
- pymt_child
7276
- pymt_hydrotrend
73-
- pymt_sedflux
7477
- bmi-topography
7578
- imageio
7679
- tqdm
7780
```
7881

79-
The environment file lists all the packages needed to run the course material.
82+
The environment file lists the packages needed to run the course material.
8083
If a package has a dependency not explicitly listed
8184
(e.g., `pymt` is built on `xarray`),
8285
`conda` finds a compatible package version for you.
8386

8487
To create the environment, type:
8588
```
86-
$ conda env create --file=environment.yaml
89+
$ conda env create --file environment.yaml
8790
```
8891

8992
Once the environment has been created, type
@@ -94,6 +97,15 @@ to make this environment current.
9497
(Note on Linux and macOS,
9598
you may have to use `source` instead of `conda` to activate the environment.)
9699

100+
Some packages used in Ivy aren't built for Windows.
101+
These packages have been listed in a second environment file,
102+
**environment.unix.yaml**.
103+
To update the `ivy` environment on Linux or macOS
104+
with these packages, type:
105+
```
106+
$ conda env update --name ivy --file environment.unix.yaml --prune
107+
```
108+
97109
Later,
98110
when finished using the environment, type
99111
```

0 commit comments

Comments
 (0)