Skip to content

Commit 2d4db5a

Browse files
authored
Improved environment management docs (#71)
* improved environment docs
1 parent 1109081 commit 2d4db5a

File tree

8 files changed

+22502
-16662
lines changed

8 files changed

+22502
-16662
lines changed

.github/workflows/qaqc.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
with:
2525
check_filenames: true
2626
check_hidden: true
27-
skip: '*.js,qaqc.yml'
27+
skip: '.git,*.js,qaqc.yml'
2828
ignore_words_list: hist,nd
2929

3030
# borrowed from https://github.com/ProjectPythia/pythia-foundations/blob/main/.github/workflows/link-checker.yaml

.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*lock.yml

CONTRIBUTING.md

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
## Contributing
2+
3+
This repository is a great opportunity to start contributing to Xarray.
4+
5+
- Report bugs, request features or submit feedback as a [GitHub Issue](https://docs.github.com/en/issues/tracking-your-work-with-issues/about-issues). First check existing issues: https://github.com/xarray-contrib/xarray-tutorial/issues !
6+
7+
- Make fixes, add content or improvements using [GitHub Pull Requests](https://docs.github.com/en/github/collaborating-with-issues-and-pull-requests/about-pull-requests), the sections below go over this process in more detail:
8+
9+
## Content Guidelines
10+
11+
Please note that examples submitted to this repository should follow these
12+
guidelines:
13+
14+
1. Run top-to-bottom without intervention from the user
15+
1. Not require external data sources that may disappear over time (external data sources that are highly unlikely to disappear are fine)
16+
1. Not be resource intensive, and should run within 2GB of memory
17+
1. Be clear and contain enough prose to explain the topic at hand
18+
1. Be concise and limited to one or two topics, such that a reader can get through the example within a few minutes of reading
19+
1. Be of general relevance to Xarray users, and so not too specific on a particular problem or use case.
20+
21+
## Fork this repository
22+
23+
We recommend first forking this repository and creating a local copy:
24+
25+
```
26+
git clone https://github.com/YOURACCOUNT/xarray-tutorial.git
27+
cd xarray-tutorial
28+
```
29+
30+
## Create a Python environment
31+
32+
You'll need `conda` or `mamba`, which can be installed from https://github.com/conda-forge/miniforge
33+
34+
We also use [conda-lock](https://conda-incubator.github.io/conda-lock/) to ensure we have reproducible environments across different operating systems
35+
36+
We also use [pre-commit hooks](https://pre-commit.com) to run styling and other checks before committing code.
37+
38+
```
39+
conda-lock install -f conda/conda-lock.yml
40+
# Or latest package versions: `mamba env create -f conda/environment-unpinned.yml`
41+
42+
conda activate xarray-tutorial
43+
44+
pre-commit install
45+
```
46+
47+
## Add content
48+
49+
Develop your new content on a branch. See [JupyterBook Docs](https://jupyterbook.org/en/stable/intro.html) for guides on adding `.md`, `.ipynb` and other content.
50+
51+
```
52+
git checkout -b newcontent
53+
git add .
54+
git commit -m "added pages x,y and improved z"
55+
```
56+
57+
## Preview your changes
58+
59+
Running jupyterbook will execute notebooks and render HTML pages for the website. Be sure to fix any execution errors and preview the website in your web browser to make sure everything looks good!
60+
61+
```
62+
jb build .
63+
```
64+
65+
## Open a pull request
66+
67+
```
68+
git push
69+
```
70+
71+
Follow the link reported in a terminal to open a pull request!

README.md

Lines changed: 25 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,34 @@
1-
# Xarray Example Notebooks
1+
# Xarray Tutorial
22

33
[![CI](https://github.com/xarray-contrib/xarray-tutorial/workflows/CI/badge.svg?branch=main)](https://github.com/xarray-contrib/xarray-tutorial/actions?query=branch%3Amain)
4+
[![Jupyter Book Badge](https://jupyterbook.org/badge.svg)](https://tutorial.xarray.dev)
5+
[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/xarray-contrib/xarray-tutorial/HEAD?urlpath=lab)
46

5-
This repository includes easy-to-run example notebooks for Xarray.
6-
They are intended to be educational and give users a start on common workflows.
7+
This is the repository for a JupyterBook website with tutorial material for [Xarray](https://github.com/pydata/xarray), _an open source project and Python package that makes working with labelled multi-dimensional arrays simple, efficient, and fun!_
78

8-
They should be easy to run locally if you download this repository.
9-
They are also available on the cloud by clicking on the link below:
9+
The website is hosted at https://tutorial.xarray.dev
1010

11-
[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/xarray-contrib/xarray-tutorial/HEAD?urlpath=lab)
11+
Tutorials are written as interactive Jupyter Notebooks with executable code examples that you can easily run and modify:
1212

13-
## Contributing
13+
#### On the Cloud
14+
15+
All notebooks can be run via the Mybinder.org 'Launch Binder' badge at the top of this page. This will load a pre-configured JupyterLab interface with all tutorial notebooks for you to run. _You have minimal computing resources and any changes you make will not be saved._
16+
17+
#### Locally
1418

15-
This repository is a great opportunity to start contributing to Xarray.
16-
Please note that examples submitted to this repository should follow these
17-
guidelines:
19+
You can also run these notebooks on your own computer! We recommend using [`conda-lock`](https://conda-incubator.github.io/conda-lock/) to ensure a fully reproducible Python environment:
1820

19-
1. Run top-to-bottom without intervention from the user
20-
2. Not require external data sources that may disappear over time (external data sources that are highly unlikely to disappear are fine)
21-
3. Not be resource intensive, and should run within 2GB of memory
22-
4. Be clear and contain enough prose to explain the topic at hand
23-
5. Be concise and limited to one or two topics, such that a reader can get through the example within a few minutes of reading
24-
6. Be of general relevance to Xarray users, and so not too specific on a particular problem or use case.
21+
```bash
22+
git clone https://github.com/xarray-contrib/xarray-tutorial.git
23+
cd xarray-tutorial
24+
25+
conda-lock install -f conda/conda-lock.yml --name xarray-tutorial
26+
# Or latest package versions: `mamba env create -f conda/environment-unpinned.yml`
27+
28+
conda activate xarray-tutorial
29+
jupyter lab
30+
```
31+
32+
## Contributing
2533

26-
_Note: Some of the content in this repository came from a similar projects: https://github.com/dask/dask-tutorial_
34+
Contributions are welcome and greatly appreciated! See our [CONTRIBUTING.md](./CONTRIBUTING.md) document.

conda/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ conda-lock install
1818
## Create/update multiplatform lockfile:
1919

2020
```
21-
conda-lock lock --mamba -f environment-unpinned.yml -p osx-64 -p linux-64 -p win-64
21+
conda-lock lock --mamba -f environment-unpinned.yml -p osx-64 -p linux-64 -p win-64 -p osx-arm64
2222
```
2323

2424
## Render a mybinder.org compatible locked file

0 commit comments

Comments
 (0)