Move wiki sources to wiki/ #31

Merged
Tirsvad merged 1 commits from fix-wiki-location into main 2026-10-13 09:44:06 +02:00
16 changed files with 146 additions and 145 deletions
+142 -141
View File
@@ -1,141 +1,142 @@
# Squirrel Census # Squirrel Census
Day 25 of Udemy's *100 Days of Code: The Complete Python Pro Bootcamp*: count the Day 25 of Udemy's *100 Days of Code: The Complete Python Pro Bootcamp*: count the
squirrels of the 2018 Central Park Squirrel Census by primary fur colour (gray, squirrels of the 2018 Central Park Squirrel Census by primary fur colour (gray,
cinnamon, black) and export the counts to `squirrel_count.csv`. Python 3.13 or cinnamon, black) and export the counts to `squirrel_count.csv`. Python 3.13 or
later, no runtime dependencies, with tests and source documentation. later, no runtime dependencies, with tests and source documentation.
![Program run][img-run] ![Program run][img-run]
## Requirements ## Requirements
- Python 3.13 or later (`python --version` on Windows, `python3 --version` on Linux and macOS). - Python 3.13 or later (`python --version` on Windows, `python3 --version` on Linux and macOS).
- `venv`, which ships with Python (on Debian: the `python3-venv` package). - `venv`, which ships with Python (on Debian: the `python3-venv` package).
- The 2018 census file. It is already in the repository under `data/`. - The 2018 census file. It is already in the repository under `data/`.
- Optional: [Doxygen][doxygen] 1.9 or later, only to build the source documentation. - Optional: [Doxygen][doxygen] 1.9 or later, only to build the source documentation.
There are no runtime dependencies: the program uses only the Python standard library There are no runtime dependencies: the program uses only the Python standard library
([ADR-0001][adr-0001]). `pytest` is needed only to run the tests. ([ADR-0001][adr-0001]). `pytest` is needed only to run the tests.
## Set up ## Set up
Create a local virtual environment named `.venv` in the project folder, upgrade `pip` Create a local virtual environment named `.venv` in the project folder, upgrade `pip`
and install the project with its development tools (pytest, ruff, mypy). and install the project with its development tools (pytest, ruff, mypy).
### Windows powershell ### Windows powershell
```powershell ```powershell
python -m venv .venv python -m venv .venv
.\.venv\Scripts\Activate.ps1 .\.venv\Scripts\Activate.ps1
python -m pip install --upgrade pip python -m pip install --upgrade pip
python -m pip install -e ".[dev]" python -m pip install -e ".[dev]"
``` ```
If PowerShell refuses to run the activation script, allow it for the current session: If PowerShell refuses to run the activation script, allow it for the current session:
`Set-ExecutionPolicy -Scope Process -ExecutionPolicy RemoteSigned`. `Set-ExecutionPolicy -Scope Process -ExecutionPolicy RemoteSigned`.
### Linux debian ### Linux debian
```bash ```bash
sudo apt install python3 python3-venv sudo apt install python3 python3-venv
python3 -m venv .venv python3 -m venv .venv
source .venv/bin/activate source .venv/bin/activate
python -m pip install --upgrade pip python -m pip install --upgrade pip
python -m pip install -e ".[dev]" python -m pip install -e ".[dev]"
``` ```
### MacOS ### MacOS
```bash ```bash
python3 -m venv .venv python3 -m venv .venv
source .venv/bin/activate source .venv/bin/activate
python -m pip install --upgrade pip python -m pip install --upgrade pip
python -m pip install -e ".[dev]" python -m pip install -e ".[dev]"
``` ```
On macOS, Python 3.13 can be installed with `brew install python@3.13`. On macOS, Python 3.13 can be installed with `brew install python@3.13`.
## Run ## Run
With the virtual environment active, run from the project folder: With the virtual environment active, run from the project folder:
```bash ```bash
python -m squirrel python -m squirrel
``` ```
The program reads `data/2018_Central_Park_Squirrel_Census_-_Squirrel_Data.csv`, prints The program reads `data/2018_Central_Park_Squirrel_Census_-_Squirrel_Data.csv`, prints
the colour counts and writes `squirrel_count.csv`: the colour counts and writes `squirrel_count.csv`:
```text ```text
Gray: 2473 Gray: 2473
Cinnamon: 392 Cinnamon: 392
Black: 103 Black: 103
``` ```
Use other files by passing them as arguments, `python -m squirrel <census file> <summary file>`. Use other files by passing them as arguments, `python -m squirrel <census file> <summary file>`.
If the census file does not exist the program prints a message and exits with status 2. If the census file does not exist the program prints a message and exits with status 2.
## Run the tests ## Run the tests
```bash ```bash
python -m pytest python -m pytest
``` ```
![Test run][img-tests] ![Test run][img-tests]
The tests use small fixture rows; one test also checks the real 2018 census file when The tests use small fixture rows; one test also checks the real 2018 census file when
it is present. it is present.
## Continuous integration ## Continuous integration
The workflow [`.gitea/workflows/ci.yml`][ci] runs for every push to `main` and for every The workflow [`.gitea/workflows/ci.yml`][ci] runs for every push to `main` and for every
pull request. It sets up Python 3.13, creates a `.venv`, upgrades `pip`, installs the pull request. It sets up Python 3.13, creates a `.venv`, upgrades `pip`, installs the
project with `.[dev]` and runs `python -m pytest`. It uses `github.*` contexts only, so project with `.[dev]` and runs `python -m pytest`. It uses `github.*` contexts only, so
it also runs on GitHub Actions. it also runs on GitHub Actions.
## Build the source documentation ## Build the source documentation
The source is documented with Doxygen comments and configured by [`Doxyfile`][doxyfile]. The source is documented with Doxygen comments and configured by [`Doxyfile`][doxyfile].
```bash ```bash
doxygen Doxyfile doxygen Doxyfile
``` ```
Open `docs/doxygen/html/index.html` in a browser. The output folder is ignored by git. Open `docs/doxygen/html/index.html` in a browser. The output folder is ignored by git.
## Project layout ## Project layout
```text ```text
.gitea/workflows/ci.yml continuous integration workflow .gitea/workflows/ci.yml continuous integration workflow
data/ the 2018 census file data/ the 2018 census file
docs/ business case, plan, milestones, models, reviews, ADRs docs/ business case, plan, milestones, models, reviews, ADRs
docs/images/ screenshots used by this README and the wiki docs/images/ screenshots used by this README and the wiki
src/squirrel/ the package: census.py, cli.py, constants.py src/squirrel/ the package: census.py, cli.py, constants.py
tests/ pytest tests tests/ pytest tests
Doxyfile Doxygen configuration wiki/ wiki pages in English, Danish (.da) and Bahasa Malaysia (.ms)
pyproject.toml project configuration (Python >=3.13, no runtime dependencies) Doxyfile Doxygen configuration
squirrel_count.csv the result of the assignment pyproject.toml project configuration (Python >=3.13, no runtime dependencies)
``` squirrel_count.csv the result of the assignment
```
The project documents, in reading order: [Business Case][bc], [Stakeholder
Analysis][sa], [Project Plan][pp], [Use Case][uc], [Domain Model][dm], [ADR-0001][adr-0001]. The project documents, in reading order: [Business Case][bc], [Stakeholder
The repository also has a wiki in English, Danish and Bahasa Malaysia. Analysis][sa], [Project Plan][pp], [Use Case][uc], [Domain Model][dm], [ADR-0001][adr-0001].
The repository also has a wiki in English, Danish and Bahasa Malaysia.
## License
## License
GNU Affero General Public License v3.0 or later. See [LICENSE][license].
GNU Affero General Public License v3.0 or later. See [LICENSE][license].
---
---
[img-run]: docs/images/run.png
[img-tests]: docs/images/tests.png [img-run]: docs/images/run.png
[doxygen]: https://www.doxygen.nl/ [img-tests]: docs/images/tests.png
[adr-0001]: docs/adr/adr-0001-standard-library-instead-of-pandas.md [doxygen]: https://www.doxygen.nl/
[ci]: .gitea/workflows/ci.yml [adr-0001]: docs/adr/adr-0001-standard-library-instead-of-pandas.md
[doxyfile]: Doxyfile [ci]: .gitea/workflows/ci.yml
[bc]: docs/business-case.md [doxyfile]: Doxyfile
[sa]: docs/stakeholder-analysis.md [bc]: docs/business-case.md
[pp]: docs/project-plan.md [sa]: docs/stakeholder-analysis.md
[uc]: docs/uc-001/uc.md [pp]: docs/project-plan.md
[dm]: docs/domain-model.md [uc]: docs/uc-001/uc.md
[license]: LICENSE [dm]: docs/domain-model.md
[license]: LICENSE
+1 -1
View File
@@ -11,7 +11,7 @@
## Version History ## Version History
| Date | Status | Author | Reviewer | Change | Commit | | Date | Status | Author | Reviewer | Change | Commit |
| --- | --- | --- | --- | --- | --- | | --- | --- | --- | --- | --- | --- |
| 2026-10-13 | Proposed | Jens Tirsvad Nielsen | AI as stand-in for S01 | Initial version | [f1b3c03] | | 2026-10-13 | Deprecated | Jens Tirsvad Nielsen | AI as stand-in for S01 | Initial version | [f1b3c03] |
| 2026-10-13 | Accepted | Jens Tirsvad Nielsen | AI as stand-in for S01 | CrossReference: added [DM-002] | [259d017] | | 2026-10-13 | Accepted | Jens Tirsvad Nielsen | AI as stand-in for S01 | CrossReference: added [DM-002] | [259d017] |
--- ---
+2 -2
View File
@@ -11,8 +11,8 @@
## Version History ## Version History
| Date | Status | Author | Reviewer | Change | Commit | | Date | Status | Author | Reviewer | Change | Commit |
| --- | --- | --- | --- | --- | --- | | --- | --- | --- | --- | --- | --- |
| 2026-10-13 | Accepted | Jens Tirsvad Nielsen | S01 | Initial version | [f1b3c03] | | 2026-10-13 | Deprecated | Jens Tirsvad Nielsen | S01 | Initial version | [f1b3c03] |
| 2026-10-13 | Proposed | Jens Tirsvad Nielsen | AI as stand-in for S01 | CrossReference: added [US-001] | [259d017] | | 2026-10-13 | Accepted | Jens Tirsvad Nielsen | AI as stand-in for S01 | CrossReference: added [US-001] | [259d017] |
--- ---
## Purpose ## Purpose
View File
+1 -1
View File
@@ -1,4 +1,4 @@
<!-- Generated from docs/wiki; edit the source pages, not the published wiki. --> <!-- Generated from wiki; edit the source pages, not the published wiki. -->
**Squirrel Census** **Squirrel Census**