You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+52-5Lines changed: 52 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,27 +1,71 @@
1
1
# data-analyses
2
+
2
3
Place for sharing quick reports, and works in progress
3
4
4
5
This repository is for quick sharing of works in progress and simple analyses.
5
6
For collaborative short-term tasks, create a new folder and work off a separate branch.
6
7
For longer-term projects, consider making a new repository!
7
8
9
+
8
10
## Using this Repo
9
11
10
12
* Use [this link](https://docs.calitp.org/data-infra/analytics_tools/saving_code.html#onboarding-setup) to get started in JupyterHub, set up SSH, and start commiting to the repo!
11
13
14
+
15
+
### JupyterHub Developers
16
+
17
+
If you are developing in JupyterHub, follow the [JupyterHub setup docs](https://docs.calitp.org/data-infra/analytics_tools/jupyterhub.html).
18
+
19
+
12
20
### Contributing
13
-
#### Pre-commit
14
21
15
-
This repository uses pre-commit hooks to format code, including [Black](https://black.readthedocs.io/en/stable/index.html). This ensures baseline consistency in code formatting.
22
+
Follow these steps to start contributing:
23
+
24
+
1.[Clone](https://docs.github.com/en/repositories/creating-and-managing-repositories/cloning-a-repository) this `data-analyses` repo.
25
+
26
+
2. From the repo root (`data-analyses/`), run `make install_env` (runs `uv sync` + pre-commit setup)
27
+
28
+
3. In JupyterHub, select the **"Pyproject Local"** kernel when opening a notebook
29
+
30
+
> [!NOTE]
31
+
> If you run into the error `No such file or directory`, you may need to [install uv](https://docs.astral.sh/uv/getting-started/installation/) running `pip install uv`.
32
+
33
+
### uv
34
+
35
+
This repository uses uv for package management. To learn more go to [uv documentation](https://docs.astral.sh/uv/concepts/projects/dependencies/).
16
36
17
-
> [!IMPORTANT]
18
-
> Before contributing to this project, please install dependencies and pre-commit by running `make install_env` in the root of the repo.
37
+
Basic commands:
19
38
20
-
Once installed, pre-commit checks will run before you can make commits locally. If a pre-commit check fails, it will need to be addressed before you can make your commit. Many formatting issues are fixed automatically within the pre-commit actions, so check the changes made by pre-commit on failure -- they may have automatically addressed the issues that caused the failure, in which case you can simply re-add the files, re-attempt the commit, and the checks will then succeed.
39
+
*`uv sync` install missing packages, update existing ones, and remove unnecessary ones to ensure the environment matches the lockfile.
40
+
*`uv add <package name>` include and install a new package to the main project.
41
+
*`uv add <package name> --dev` include and install new packages/dependencies to the `dev` group.
42
+
*`uv add <package name> --portfolio` include and install new packages/dependencies to the `portfolio` group.
43
+
*`uv add <package name> --test` include and install new packages/dependencies used only for testing under the `test` group.
44
+
*`uv remove <package name>` remove and uninstall packages/dependencies from the project.
45
+
46
+
### nbdime
47
+
48
+
[`nbdime`](https://github.com/jupyter/nbdime) provides command-line tools for diffing and merging notebooks.
49
+
50
+
Basic commands:
51
+
52
+
*`nbdiff` compare notebooks in a terminal-friendly way.
53
+
*`nbmerge` three-way merge of notebooks with automatic conflict resolution.
54
+
*`nbdiff-web` shows you a rich rendered diff of notebooks.
55
+
*`nbmerge-web` gives you a web-based three-way merge tool for notebooks.
56
+
*`nbshow` present a single notebook in a terminal-friendly way.
57
+
58
+
### Pre-commit
59
+
60
+
This repository uses pre-commit hooks to format code, including [Black](https://black.readthedocs.io/en/stable/index.html). This ensures baseline consistency in code formatting.
61
+
62
+
Pre-commit checks will run before you can make commits locally. If a pre-commit check fails, it will need to be addressed before you can make your commit.
63
+
Many formatting issues are fixed automatically within the pre-commit actions, so check the changes made by pre-commit on failure -- they may have automatically addressed the issues that caused the failure, in which case you can simply re-add the files, re-attempt the commit, and the checks will then succeed.
21
64
22
65
Installing pre-commit locally saves time dealing with formatting issues on pull requests. There is a [GitHub Action](./.github/workflows/lint.yml)
23
66
that runs pre-commit on all files, not just changed ones, as part of our continuous integration.
0 commit comments