Skip to content

Commit 077a49d

Browse files
authored
Regroup/expand installation instructions (#5)
* detail user and dev installation separately, move tutorial section PET packages can be installed directly from GitHub, installation can highlight this possibility for advanced users, removing the need to clone the repository if one just want to incorporate PET in their project. * move tutorial installation instructions to main README This should make it more straightforward for a new user to find the installation instructions. * make windows note as a warning
1 parent bb734a2 commit 077a49d

File tree

3 files changed

+63
-53
lines changed

3 files changed

+63
-53
lines changed

README.md

Lines changed: 59 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -11,60 +11,94 @@
1111
> to change in the next few months.
1212
>
1313
14-
# New User Information
14+
# Getting Started
1515

16-
Guidelines for new users still need to be developed. For those looking to get started, follow the installation instructions below in this README, and then head to the tutorial sub-package to get going.
16+
Guidelines for new users still need to be developed.
17+
For new users, we recommend following the instructions in the [Tutorials](#tutorials) section of this README.
18+
Installation instructions are intended for users already familiar with the project.
1719

18-
When this repository is ready for wider use, the intention is to release PyEarthTools on PyPI and conda-forge.
20+
# Installation
21+
22+
## Repository Layout
1923

20-
# Repository Layout
24+
This is a so-called monorepo. `PyEarthTools` comprises multiple, modular packages within a shared namespace that inter-operate in order to provide the overall functionality of the framework. It is not necessary to install all of them, and it is envisioned that many users are likely to want only some parts of the framework. As such, each sub-package is a fully independent Python package, with its own requirements and its own installation process. Each of these sub-packages lies in the [`packages`](packages/) subdirectory.
2125

22-
This is a so-called monorepo. PyEarthTools comprises multiple, modular packages within a shared namespace that inter-operate in order to provide the overall functionality of the framework. It is not necessary to install all of them, and it is envisioned that many users are likely to want only some parts of the framework. As such, each sub-package is a fully independent Python package, with its own requirements and its own installation process.
26+
## User installation
2327

24-
Each of these sub-packages lies in the 'packages' subdirectory. Developers of `PyEarthTools` will most likely want to check out the entire monorepo and work on changesets which may span sub-packages. Each sub-package is versioned separately, so bugfixes or updates in a single sub-package can be performed independently without requiring a new release of the entire ecosystem.
28+
Each of PyEarthTools package can be installed separately using `pip`, directly from GitHub.
29+
For example, to install the `pyearthtools-utils` package, use:
2530

26-
For simplicity, the instructions here explain how to check out the whole codebase and install everything for a developer context.
31+
```
32+
pip install git+https://github.com/ACCESS-Community-Hub/PyEarthTools.git#subdirectory=packages/utils
33+
```
2734

35+
Other available packages are `pyearthtools-data`, `pyearthtools-pipeline` and `pyearthtools-training`, that can be installed as follows:
2836

29-
# Installation
37+
```
38+
pip install git+https://github.com/ACCESS-Community-Hub/PyEarthTools.git#subdirectory=packages/data
39+
pip install git+https://github.com/ACCESS-Community-Hub/PyEarthTools.git#subdirectory=packages/pipeline
40+
pip install git+https://github.com/ACCESS-Community-Hub/PyEarthTools.git#subdirectory=packages/training
41+
```
42+
43+
> [!NOTE]
44+
> When this repository is ready for wider use, the intention is to release `PyEarthTools` on PyPI and conda-forge.
3045
31-
First clone the repository using the `develop` branch:
46+
## Developer installation
47+
48+
Developers of `PyEarthTools` will most likely want to check out the entire monorepo and work on changesets which may span sub-packages. Each sub-package is versioned separately, so bugfixes or updates in a single sub-package can be performed independently without requiring a new release of the entire ecosystem.
49+
50+
First clone this repository:
3251

3352
```
34-
git clone [email protected]:ACCESS-Community-Hub/PyEarthTools.git
35-
cd pyearthtools
53+
git clone https://github.com/ACCESS-Community-Hub/PyEarthTools.git
3654
```
3755

38-
Then create a Python virtual environment:
56+
and install all packages in "editable" mode with
3957

4058
```
41-
python3 -m venv venv
42-
venv/bin/activate
59+
cd PyEarthTools
60+
pip install -r requirements-dev.txt
4361
```
4462

45-
or a Conda environment to install all dependencies:
63+
> [!WARNING]
64+
> We do recommend using a Python virtual environment or a Conda environment when developing, to isolate this installation from the rest of your system.
65+
66+
67+
# Tutorials
68+
69+
For new users, we recommend running the tutorials first, to see `PyEarthTools` in action and get familiar with it.
70+
71+
The following instructions assume that you have access to [Conda](https://docs.conda.io/projects/conda/en/latest/index.html) on your system.
72+
73+
> [!WARNING]
74+
> These instructions have been tested on Linux and macOS. We have not tested them on **Windows**.
75+
> We welcome any contribution to improve this situation 🙂.
76+
77+
First clone this repository and switch to the tutorials folder:
4678

4779
```
48-
conda create -p ./venv -y python=3.11
49-
conda activate ./venv
80+
git clone https://github.com/ACCESS-Community-Hub/PyEarthTools.git
81+
cd PyEarthTools/packages/tutorial
5082
```
5183

52-
And install all dependencies via pip:
84+
Then create a Conda environment to install all dependencies:
5385

5486
```
55-
pip install -r requirements-dev.txt
87+
conda env create -f environment.yml -p ./venv
5688
```
5789

58-
You can run some of the tests to check that your installation worked:
90+
Next, to run the example [notebooks](PyEarthTools/packages/tutorial/nbook/), you can either
91+
92+
- start a JupyterLab instance
5993

6094
```
61-
pytest packages/data/tests/
95+
conda activate ./venv
96+
jupyter lab
6297
```
6398

64-
To run example [notebooks from the tutorial package](packages/tutorial/nbook), you may need to also install a Jupyter kernel for your environment:
99+
- or install a Jupyter kernel to use in a pre-existing JupyterLab installation
65100

66101
```
67-
# from the activate virtual or conda environment
68-
pip install ipykernel
69-
python -m ipykernel install --user --name pyearthtools
102+
conda activate ./venv
103+
python -m ipykernel install --user --name PET-tutorial
70104
```

packages/tutorial/README.md

Lines changed: 2 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,5 @@
11
# PyEarthTools tutorials
22

3-
First clone this repository:
3+
Tutorial material to get started with `PyEarthTools`.
44

5-
```
6-
git clone https://github.com/ACCESS-Community-Hub/PyEarthTools.git
7-
cd PyEarthTools/packages/tutorial
8-
```
9-
10-
Then create a Conda environment to install all dependencies:
11-
12-
```
13-
conda env create -f environment.yml -p ./venv
14-
```
15-
16-
To run the example [notebooks](nbook/), you can either
17-
18-
- start a JupyterLab instance
19-
20-
```
21-
conda activate ./venv
22-
jupyter lab
23-
```
24-
25-
- or install a Jupyter kernel to use in a pre-existing JupyterLab installation
26-
27-
```
28-
conda activate ./venv
29-
python -m ipykernel install --user --name PET-tutorial
30-
```
5+
See the main [README](../../README.md#tutorials) for instructions.

requirements-dev.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
-e packages/utils
22
-e packages/data
3-
-e packages/tutorial/
3+
-e packages/training
44
-e packages/pipeline
5+
-e packages/tutorial

0 commit comments

Comments
 (0)