Compare commits
6
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
632fa61b89 | ||
|
|
d825bef0f1 | ||
|
|
9e41ae87b9 | ||
|
|
57e12637f0 | ||
|
|
b0132498ba | ||
|
|
933f71eb39 |
@@ -1,20 +1,19 @@
|
||||
# Doxygen configuration for the squirrel census project.
|
||||
# Build the source documentation with: doxygen Doxyfile
|
||||
# Output goes to docs/doxygen/ (ignored by git). Everything not listed here
|
||||
# keeps the Doxygen default.
|
||||
|
||||
PROJECT_NAME = "Squirrel Census"
|
||||
PROJECT_BRIEF = "Count squirrels by primary fur colour"
|
||||
PROJECT_NUMBER = 0.1.0
|
||||
OUTPUT_DIRECTORY = docs/doxygen
|
||||
INPUT = src README.md
|
||||
FILE_PATTERNS = *.py *.md
|
||||
RECURSIVE = YES
|
||||
USE_MDFILE_AS_MAINPAGE = README.md
|
||||
OPTIMIZE_OUTPUT_JAVA = YES
|
||||
EXTRACT_ALL = YES
|
||||
GENERATE_HTML = YES
|
||||
GENERATE_LATEX = NO
|
||||
QUIET = YES
|
||||
WARN_IF_UNDOCUMENTED = YES
|
||||
WARN_AS_ERROR = NO
|
||||
# Doxygen configuration for the squirrel census project.
|
||||
# Build the source documentation with: doxygen Doxyfile
|
||||
# Output goes to docs/doxygen/ (ignored by git). Everything not listed here
|
||||
# keeps the Doxygen default.
|
||||
|
||||
PROJECT_NAME = "Squirrel Census"
|
||||
PROJECT_BRIEF = "Count squirrels by primary fur colour"
|
||||
PROJECT_NUMBER = 0.1.0
|
||||
OUTPUT_DIRECTORY = docs/doxygen
|
||||
INPUT = src docs/mainpage.dox
|
||||
FILE_PATTERNS = *.py *.dox
|
||||
RECURSIVE = YES
|
||||
OPTIMIZE_OUTPUT_JAVA = YES
|
||||
EXTRACT_ALL = YES
|
||||
GENERATE_HTML = YES
|
||||
GENERATE_LATEX = NO
|
||||
QUIET = YES
|
||||
WARN_IF_UNDOCUMENTED = YES
|
||||
WARN_AS_ERROR = NO
|
||||
|
||||
@@ -1,141 +1,142 @@
|
||||
# Squirrel Census
|
||||
|
||||
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,
|
||||
cinnamon, black) and export the counts to `squirrel_count.csv`. Python 3.13 or
|
||||
later, no runtime dependencies, with tests and source documentation.
|
||||
|
||||
![Program run][img-run]
|
||||
|
||||
## Requirements
|
||||
|
||||
- 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).
|
||||
- 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.
|
||||
|
||||
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.
|
||||
|
||||
## Set up
|
||||
|
||||
Create a local virtual environment named `.venv` in the project folder, upgrade `pip`
|
||||
and install the project with its development tools (pytest, ruff, mypy).
|
||||
|
||||
### Windows powershell
|
||||
|
||||
```powershell
|
||||
python -m venv .venv
|
||||
.\.venv\Scripts\Activate.ps1
|
||||
python -m pip install --upgrade pip
|
||||
python -m pip install -e ".[dev]"
|
||||
```
|
||||
|
||||
If PowerShell refuses to run the activation script, allow it for the current session:
|
||||
`Set-ExecutionPolicy -Scope Process -ExecutionPolicy RemoteSigned`.
|
||||
|
||||
### Linux debian
|
||||
|
||||
```bash
|
||||
sudo apt install python3 python3-venv
|
||||
python3 -m venv .venv
|
||||
source .venv/bin/activate
|
||||
python -m pip install --upgrade pip
|
||||
python -m pip install -e ".[dev]"
|
||||
```
|
||||
|
||||
### MacOS
|
||||
|
||||
```bash
|
||||
python3 -m venv .venv
|
||||
source .venv/bin/activate
|
||||
python -m pip install --upgrade pip
|
||||
python -m pip install -e ".[dev]"
|
||||
```
|
||||
|
||||
On macOS, Python 3.13 can be installed with `brew install python@3.13`.
|
||||
|
||||
## Run
|
||||
|
||||
With the virtual environment active, run from the project folder:
|
||||
|
||||
```bash
|
||||
python -m squirrel
|
||||
```
|
||||
|
||||
The program reads `data/2018_Central_Park_Squirrel_Census_-_Squirrel_Data.csv`, prints
|
||||
the colour counts and writes `squirrel_count.csv`:
|
||||
|
||||
```text
|
||||
Gray: 2473
|
||||
Cinnamon: 392
|
||||
Black: 103
|
||||
```
|
||||
|
||||
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.
|
||||
|
||||
## Run the tests
|
||||
|
||||
```bash
|
||||
python -m pytest
|
||||
```
|
||||
|
||||
![Test run][img-tests]
|
||||
|
||||
The tests use small fixture rows; one test also checks the real 2018 census file when
|
||||
it is present.
|
||||
|
||||
## Continuous integration
|
||||
|
||||
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
|
||||
project with `.[dev]` and runs `python -m pytest`. It uses `github.*` contexts only, so
|
||||
it also runs on GitHub Actions.
|
||||
|
||||
## Build the source documentation
|
||||
|
||||
The source is documented with Doxygen comments and configured by [`Doxyfile`][doxyfile].
|
||||
|
||||
```bash
|
||||
doxygen Doxyfile
|
||||
```
|
||||
|
||||
Open `docs/doxygen/html/index.html` in a browser. The output folder is ignored by git.
|
||||
|
||||
## Project layout
|
||||
|
||||
```text
|
||||
.gitea/workflows/ci.yml continuous integration workflow
|
||||
data/ the 2018 census file
|
||||
docs/ business case, plan, milestones, models, reviews, ADRs
|
||||
docs/images/ screenshots used by this README and the wiki
|
||||
src/squirrel/ the package: census.py, cli.py, constants.py
|
||||
tests/ pytest tests
|
||||
Doxyfile Doxygen configuration
|
||||
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 repository also has a wiki in English, Danish and Bahasa Malaysia.
|
||||
|
||||
## 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
|
||||
[doxygen]: https://www.doxygen.nl/
|
||||
[adr-0001]: docs/adr/adr-0001-standard-library-instead-of-pandas.md
|
||||
[ci]: .gitea/workflows/ci.yml
|
||||
[doxyfile]: Doxyfile
|
||||
[bc]: docs/business-case.md
|
||||
[sa]: docs/stakeholder-analysis.md
|
||||
[pp]: docs/project-plan.md
|
||||
[uc]: docs/uc-001/uc.md
|
||||
[dm]: docs/domain-model.md
|
||||
[license]: LICENSE
|
||||
# Squirrel Census
|
||||
|
||||
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,
|
||||
cinnamon, black) and export the counts to `squirrel_count.csv`. Python 3.13 or
|
||||
later, no runtime dependencies, with tests and source documentation.
|
||||
|
||||
![Program run][img-run]
|
||||
|
||||
## Requirements
|
||||
|
||||
- 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).
|
||||
- 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.
|
||||
|
||||
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.
|
||||
|
||||
## Set up
|
||||
|
||||
Create a local virtual environment named `.venv` in the project folder, upgrade `pip`
|
||||
and install the project with its development tools (pytest, ruff, mypy).
|
||||
|
||||
### Windows powershell
|
||||
|
||||
```powershell
|
||||
python -m venv .venv
|
||||
.\.venv\Scripts\Activate.ps1
|
||||
python -m pip install --upgrade pip
|
||||
python -m pip install -e ".[dev]"
|
||||
```
|
||||
|
||||
If PowerShell refuses to run the activation script, allow it for the current session:
|
||||
`Set-ExecutionPolicy -Scope Process -ExecutionPolicy RemoteSigned`.
|
||||
|
||||
### Linux debian
|
||||
|
||||
```bash
|
||||
sudo apt install python3 python3-venv
|
||||
python3 -m venv .venv
|
||||
source .venv/bin/activate
|
||||
python -m pip install --upgrade pip
|
||||
python -m pip install -e ".[dev]"
|
||||
```
|
||||
|
||||
### MacOS
|
||||
|
||||
```bash
|
||||
python3 -m venv .venv
|
||||
source .venv/bin/activate
|
||||
python -m pip install --upgrade pip
|
||||
python -m pip install -e ".[dev]"
|
||||
```
|
||||
|
||||
On macOS, Python 3.13 can be installed with `brew install python@3.13`.
|
||||
|
||||
## Run
|
||||
|
||||
With the virtual environment active, run from the project folder:
|
||||
|
||||
```bash
|
||||
python -m squirrel
|
||||
```
|
||||
|
||||
The program reads `data/2018_Central_Park_Squirrel_Census_-_Squirrel_Data.csv`, prints
|
||||
the colour counts and writes `squirrel_count.csv`:
|
||||
|
||||
```text
|
||||
Gray: 2473
|
||||
Cinnamon: 392
|
||||
Black: 103
|
||||
```
|
||||
|
||||
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.
|
||||
|
||||
## Run the tests
|
||||
|
||||
```bash
|
||||
python -m pytest
|
||||
```
|
||||
|
||||
![Test run][img-tests]
|
||||
|
||||
The tests use small fixture rows; one test also checks the real 2018 census file when
|
||||
it is present.
|
||||
|
||||
## Continuous integration
|
||||
|
||||
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
|
||||
project with `.[dev]` and runs `python -m pytest`. It uses `github.*` contexts only, so
|
||||
it also runs on GitHub Actions.
|
||||
|
||||
## Build the source documentation
|
||||
|
||||
The source is documented with Doxygen comments and configured by [`Doxyfile`][doxyfile].
|
||||
|
||||
```bash
|
||||
doxygen Doxyfile
|
||||
```
|
||||
|
||||
Open `docs/doxygen/html/index.html` in a browser. The output folder is ignored by git.
|
||||
|
||||
## Project layout
|
||||
|
||||
```text
|
||||
.gitea/workflows/ci.yml continuous integration workflow
|
||||
data/ the 2018 census file
|
||||
docs/ business case, plan, milestones, models, reviews, ADRs
|
||||
docs/images/ screenshots used by this README and the wiki
|
||||
src/squirrel/ the package: census.py, cli.py, constants.py
|
||||
tests/ pytest tests
|
||||
wiki/ wiki pages in English, Danish (.da) and Bahasa Malaysia (.ms)
|
||||
Doxyfile Doxygen configuration
|
||||
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 repository also has a wiki in English, Danish and Bahasa Malaysia.
|
||||
|
||||
## 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
|
||||
[doxygen]: https://www.doxygen.nl/
|
||||
[adr-0001]: docs/adr/adr-0001-standard-library-instead-of-pandas.md
|
||||
[ci]: .gitea/workflows/ci.yml
|
||||
[doxyfile]: Doxyfile
|
||||
[bc]: docs/business-case.md
|
||||
[sa]: docs/stakeholder-analysis.md
|
||||
[pp]: docs/project-plan.md
|
||||
[uc]: docs/uc-001/uc.md
|
||||
[dm]: docs/domain-model.md
|
||||
[license]: LICENSE
|
||||
|
||||
+1
-1
@@ -11,7 +11,7 @@
|
||||
## Version History
|
||||
| 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] |
|
||||
---
|
||||
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
/**
|
||||
@mainpage Squirrel Census
|
||||
|
||||
Count the squirrels of the 2018 Central Park Squirrel Census by primary fur colour
|
||||
(Gray, Cinnamon, Black) and export the counts to `squirrel_count.csv`.
|
||||
|
||||
The steps follow the Udemy "100 Days of Code" lecture of day 25: squirrel.census.read_csv,
|
||||
squirrel.census.count_by_fur_color, squirrel.census.build_summary and
|
||||
squirrel.census.write_csv. The command line entry point is squirrel.cli.main, started
|
||||
with `python -m squirrel`. Every literal is defined once in squirrel.constants.
|
||||
|
||||
The package uses only the Python standard library.
|
||||
*/
|
||||
@@ -11,8 +11,8 @@
|
||||
## Version History
|
||||
| Date | Status | Author | Reviewer | Change | Commit |
|
||||
| --- | --- | --- | --- | --- | --- |
|
||||
| 2026-10-13 | Accepted | 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 | Deprecated | Jens Tirsvad Nielsen | S01 | Initial version | [f1b3c03] |
|
||||
| 2026-10-13 | Accepted | Jens Tirsvad Nielsen | AI as stand-in for S01 | CrossReference: added [US-001] | [259d017] |
|
||||
---
|
||||
|
||||
## Purpose
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
🌐 [English](Description) · **Dansk** · [Bahasa Melayu](Description.ms)
|
||||
|
||||
# Beskrivelse
|
||||
|
||||
## Hvad programmet gør
|
||||
|
||||
Programmet følger lektionens trin:
|
||||
|
||||
1. `read_csv` læser optællingsfilen.
|
||||
2. `count_by_fur_color` tæller observationerne af Gray, Cinnamon og Black.
|
||||
3. `build_summary` gør tallene til rækkerne i en opsummering.
|
||||
4. `write_csv` skriver opsummeringen til `squirrel_count.csv`.
|
||||
|
||||
På optællingsfilen fra 2018 er resultatet Gray 2473, Cinnamon 392 og Black 103. Observationer uden pelsfarve tælles ikke med i nogen af dem.
|
||||
|
||||
## Hvorfor ikke Pandas
|
||||
|
||||
Lektionen bruger Pandas. Dette projekt bruger kun Pythons standardbibliotek (`csv` og `collections.Counter`), så der ikke er noget at installere for at køre det. Beslutningen er beskrevet som ADR-0001 i repositoryet.
|
||||
|
||||
## Opbygning
|
||||
|
||||
| Sti | Indhold |
|
||||
| --- | --- |
|
||||
| `src/squirrel/census.py` | De fire trin ovenfor |
|
||||
| `src/squirrel/cli.py` | Kommandolinjen, `python -m squirrel` |
|
||||
| `src/squirrel/constants.py` | Alle konstanter, defineret ét sted |
|
||||
| `tests/` | pytest-testene |
|
||||
| `docs/` | Business case, plan, modeller, reviewposter |
|
||||
|
||||
## Kvalitet
|
||||
|
||||
Alle dokumenter og al kode er gennemgået mod tjeklisterne i SQA- og QC-frameworket i autonom tilstand: reviewer er en AI-stedfortræder, så reviewene er ikke uafhængige.
|
||||
@@ -0,0 +1,32 @@
|
||||
🌐 **English** · [Dansk](Description.da) · [Bahasa Melayu](Description.ms)
|
||||
|
||||
# Description
|
||||
|
||||
## What it does
|
||||
|
||||
The program follows the steps of the lecture:
|
||||
|
||||
1. `read_csv` reads the census file.
|
||||
2. `count_by_fur_color` counts the sightings of Gray, Cinnamon and Black.
|
||||
3. `build_summary` turns the counts into the rows of a summary.
|
||||
4. `write_csv` writes the summary to `squirrel_count.csv`.
|
||||
|
||||
On the 2018 census file the result is Gray 2473, Cinnamon 392 and Black 103. Sightings without a fur colour are counted in none of them.
|
||||
|
||||
## Why no Pandas
|
||||
|
||||
The lecture uses Pandas. This project uses only the Python standard library (`csv` and `collections.Counter`) so that there is nothing to install to run it. The decision is recorded as ADR-0001 in the repository.
|
||||
|
||||
## Layout
|
||||
|
||||
| Path | Content |
|
||||
| --- | --- |
|
||||
| `src/squirrel/census.py` | The four steps above |
|
||||
| `src/squirrel/cli.py` | The command line, `python -m squirrel` |
|
||||
| `src/squirrel/constants.py` | Every literal, defined once |
|
||||
| `tests/` | The pytest tests |
|
||||
| `docs/` | Business case, plan, models, review records |
|
||||
|
||||
## Quality
|
||||
|
||||
Every document and every piece of code was reviewed against the checklists of the SQA and QC framework, in autonomous mode: the reviewer is an AI stand-in, so the reviews are not independent.
|
||||
@@ -0,0 +1,32 @@
|
||||
🌐 [English](Description) · [Dansk](Description.da) · **Bahasa Melayu**
|
||||
|
||||
# Penerangan
|
||||
|
||||
## Apa yang dilakukan program
|
||||
|
||||
Program mengikut langkah dalam pelajaran:
|
||||
|
||||
1. `read_csv` membaca fail banci.
|
||||
2. `count_by_fur_color` mengira pemerhatian Gray, Cinnamon dan Black.
|
||||
3. `build_summary` menukar kiraan kepada baris ringkasan.
|
||||
4. `write_csv` menulis ringkasan ke `squirrel_count.csv`.
|
||||
|
||||
Pada fail banci 2018 hasilnya ialah Gray 2473, Cinnamon 392 dan Black 103. Pemerhatian tanpa warna bulu tidak dikira dalam mana-mana satu.
|
||||
|
||||
## Mengapa tidak menggunakan Pandas
|
||||
|
||||
Pelajaran menggunakan Pandas. Projek ini hanya menggunakan pustaka standard Python (`csv` dan `collections.Counter`) supaya tiada apa-apa untuk dipasang bagi menjalankannya. Keputusan itu direkodkan sebagai ADR-0001 dalam repositori.
|
||||
|
||||
## Susun atur
|
||||
|
||||
| Laluan | Kandungan |
|
||||
| --- | --- |
|
||||
| `src/squirrel/census.py` | Empat langkah di atas |
|
||||
| `src/squirrel/cli.py` | Baris perintah, `python -m squirrel` |
|
||||
| `src/squirrel/constants.py` | Semua pemalar, ditakrif sekali |
|
||||
| `tests/` | Ujian pytest |
|
||||
| `docs/` | Kes perniagaan, pelan, model, rekod semakan |
|
||||
|
||||
## Kualiti
|
||||
|
||||
Setiap dokumen dan kod disemak berdasarkan senarai semak rangka kerja SQA dan QC dalam mod autonomi: penyemak ialah pengganti AI, jadi semakan itu tidak bebas.
|
||||
@@ -0,0 +1,15 @@
|
||||
🌐 [English](Home) · **Dansk** · [Bahasa Melayu](Home.ms)
|
||||
|
||||
# Egern-optælling
|
||||
|
||||
Dag 25 i Udemys *100 Days of Code: The Complete Python Pro Bootcamp*: tæl egernene i Central Parks egern-optælling fra 2018 efter primær pelsfarve (grå, kanel, sort) og eksportér tallene til `squirrel_count.csv`.
|
||||
|
||||

|
||||
|
||||
| Side | Læs den, når du vil |
|
||||
| --- | --- |
|
||||
| [Installation](Install.da) | Oprette et `.venv` og installere projektet på Windows PowerShell, Linux Debian eller macOS |
|
||||
| [Brug](Usage.da) | Køre programmet og testene |
|
||||
| [Beskrivelse](Description.da) | Forstå hvordan koden er bygget, og hvorfor den ikke har kørselsafhængigheder |
|
||||
|
||||
Koden, testene og projektdokumenterne ligger i [repositoryet](https://git.tirsystem.com/Tirsvad-Udemy-100-days-of-code/025-squirrel).
|
||||
@@ -0,0 +1,15 @@
|
||||
🌐 **English** · [Dansk](Home.da) · [Bahasa Melayu](Home.ms)
|
||||
|
||||
# Squirrel Census
|
||||
|
||||
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, cinnamon, black) and export the counts to `squirrel_count.csv`.
|
||||
|
||||

|
||||
|
||||
| Page | Read it when you want to |
|
||||
| --- | --- |
|
||||
| [Install](Install) | Create a `.venv` and install the project on Windows PowerShell, Linux Debian or macOS |
|
||||
| [Usage](Usage) | Run the program and the tests |
|
||||
| [Description](Description) | Understand how the code is built and why it has no runtime dependencies |
|
||||
|
||||
The code, the tests and the project documents are in the [repository](https://git.tirsystem.com/Tirsvad-Udemy-100-days-of-code/025-squirrel).
|
||||
@@ -0,0 +1,15 @@
|
||||
🌐 [English](Home) · [Dansk](Home.da) · **Bahasa Melayu**
|
||||
|
||||
# Banci Tupai
|
||||
|
||||
Hari ke-25 dalam *100 Days of Code: The Complete Python Pro Bootcamp* Udemy: kira tupai dalam Banci Tupai Central Park 2018 mengikut warna bulu utama (kelabu, kayu manis, hitam) dan eksport kiraan ke `squirrel_count.csv`.
|
||||
|
||||

|
||||
|
||||
| Halaman | Baca apabila anda mahu |
|
||||
| --- | --- |
|
||||
| [Pemasangan](Install.ms) | Mencipta `.venv` dan memasang projek di Windows PowerShell, Linux Debian atau macOS |
|
||||
| [Penggunaan](Usage.ms) | Menjalankan program dan ujian |
|
||||
| [Penerangan](Description.ms) | Memahami cara kod dibina dan sebab ia tiada kebergantungan masa jalan |
|
||||
|
||||
Kod, ujian dan dokumen projek berada dalam [repositori](https://git.tirsystem.com/Tirsvad-Udemy-100-days-of-code/025-squirrel).
|
||||
@@ -0,0 +1,35 @@
|
||||
🌐 [English](Install) · **Dansk** · [Bahasa Melayu](Install.ms)
|
||||
|
||||
# Installation
|
||||
|
||||
Projektet kræver **Python 3.13 eller nyere**. Det har ingen kørselsafhængigheder; `pytest`, `ruff` og `mypy` er udviklingsværktøjer.
|
||||
|
||||
## Windows PowerShell
|
||||
|
||||
```powershell
|
||||
python -m venv .venv
|
||||
.\.venv\Scripts\Activate.ps1
|
||||
python -m pip install --upgrade pip
|
||||
python -m pip install -e ".[dev]"
|
||||
```
|
||||
|
||||
## Linux Debian
|
||||
|
||||
```bash
|
||||
sudo apt install python3 python3-venv
|
||||
python3 -m venv .venv
|
||||
source .venv/bin/activate
|
||||
python -m pip install --upgrade pip
|
||||
python -m pip install -e ".[dev]"
|
||||
```
|
||||
|
||||
## macOS
|
||||
|
||||
```bash
|
||||
python3 -m venv .venv
|
||||
source .venv/bin/activate
|
||||
python -m pip install --upgrade pip
|
||||
python -m pip install -e ".[dev]"
|
||||
```
|
||||
|
||||
Næste: [Brug](Usage.da).
|
||||
@@ -0,0 +1,35 @@
|
||||
🌐 **English** · [Dansk](Install.da) · [Bahasa Melayu](Install.ms)
|
||||
|
||||
# Install
|
||||
|
||||
The project needs **Python 3.13 or later**. It has no runtime dependencies; `pytest`, `ruff` and `mypy` are development tools.
|
||||
|
||||
## Windows PowerShell
|
||||
|
||||
```powershell
|
||||
python -m venv .venv
|
||||
.\.venv\Scripts\Activate.ps1
|
||||
python -m pip install --upgrade pip
|
||||
python -m pip install -e ".[dev]"
|
||||
```
|
||||
|
||||
## Linux Debian
|
||||
|
||||
```bash
|
||||
sudo apt install python3 python3-venv
|
||||
python3 -m venv .venv
|
||||
source .venv/bin/activate
|
||||
python -m pip install --upgrade pip
|
||||
python -m pip install -e ".[dev]"
|
||||
```
|
||||
|
||||
## macOS
|
||||
|
||||
```bash
|
||||
python3 -m venv .venv
|
||||
source .venv/bin/activate
|
||||
python -m pip install --upgrade pip
|
||||
python -m pip install -e ".[dev]"
|
||||
```
|
||||
|
||||
Next: [Usage](Usage).
|
||||
@@ -0,0 +1,35 @@
|
||||
🌐 [English](Install) · [Dansk](Install.da) · **Bahasa Melayu**
|
||||
|
||||
# Pemasangan
|
||||
|
||||
Projek ini memerlukan **Python 3.13 atau lebih baharu**. Ia tiada kebergantungan masa jalan; `pytest`, `ruff` dan `mypy` ialah alat pembangunan.
|
||||
|
||||
## Windows PowerShell
|
||||
|
||||
```powershell
|
||||
python -m venv .venv
|
||||
.\.venv\Scripts\Activate.ps1
|
||||
python -m pip install --upgrade pip
|
||||
python -m pip install -e ".[dev]"
|
||||
```
|
||||
|
||||
## Linux Debian
|
||||
|
||||
```bash
|
||||
sudo apt install python3 python3-venv
|
||||
python3 -m venv .venv
|
||||
source .venv/bin/activate
|
||||
python -m pip install --upgrade pip
|
||||
python -m pip install -e ".[dev]"
|
||||
```
|
||||
|
||||
## macOS
|
||||
|
||||
```bash
|
||||
python3 -m venv .venv
|
||||
source .venv/bin/activate
|
||||
python -m pip install --upgrade pip
|
||||
python -m pip install -e ".[dev]"
|
||||
```
|
||||
|
||||
Seterusnya: [Penggunaan](Usage.ms).
|
||||
@@ -0,0 +1,33 @@
|
||||
🌐 [English](Usage) · **Dansk** · [Bahasa Melayu](Usage.ms)
|
||||
|
||||
# Brug
|
||||
|
||||
## Kør programmet
|
||||
|
||||
Med det virtuelle miljø aktivt, fra projektmappen:
|
||||
|
||||
```bash
|
||||
python -m squirrel
|
||||
```
|
||||
|
||||
Programmet læser `data/2018_Central_Park_Squirrel_Census_-_Squirrel_Data.csv`, skriver tallene for hver pelsfarve og gemmer `squirrel_count.csv`.
|
||||
|
||||

|
||||
|
||||
Brug andre filer med `python -m squirrel <optællingsfil> <opsummeringsfil>`. Findes optællingsfilen ikke, skriver programmet `Census file not found` og afslutter med status 2.
|
||||
|
||||
## Kør testene
|
||||
|
||||
```bash
|
||||
python -m pytest
|
||||
```
|
||||
|
||||

|
||||
|
||||
## Byg kildedokumentationen
|
||||
|
||||
```bash
|
||||
doxygen Doxyfile
|
||||
```
|
||||
|
||||
Åbn `docs/doxygen/html/index.html`.
|
||||
@@ -0,0 +1,33 @@
|
||||
🌐 **English** · [Dansk](Usage.da) · [Bahasa Melayu](Usage.ms)
|
||||
|
||||
# Usage
|
||||
|
||||
## Run the program
|
||||
|
||||
With the virtual environment active, from the project folder:
|
||||
|
||||
```bash
|
||||
python -m squirrel
|
||||
```
|
||||
|
||||
The program reads `data/2018_Central_Park_Squirrel_Census_-_Squirrel_Data.csv`, prints the colour counts and writes `squirrel_count.csv`.
|
||||
|
||||

|
||||
|
||||
Use other files with `python -m squirrel <census file> <summary file>`. If the census file does not exist, the program prints `Census file not found` and exits with status 2.
|
||||
|
||||
## Run the tests
|
||||
|
||||
```bash
|
||||
python -m pytest
|
||||
```
|
||||
|
||||

|
||||
|
||||
## Build the source documentation
|
||||
|
||||
```bash
|
||||
doxygen Doxyfile
|
||||
```
|
||||
|
||||
Open `docs/doxygen/html/index.html`.
|
||||
@@ -0,0 +1,33 @@
|
||||
🌐 [English](Usage) · [Dansk](Usage.da) · **Bahasa Melayu**
|
||||
|
||||
# Penggunaan
|
||||
|
||||
## Jalankan program
|
||||
|
||||
Dengan persekitaran maya aktif, dari folder projek:
|
||||
|
||||
```bash
|
||||
python -m squirrel
|
||||
```
|
||||
|
||||
Program membaca `data/2018_Central_Park_Squirrel_Census_-_Squirrel_Data.csv`, mencetak kiraan setiap warna bulu dan menulis `squirrel_count.csv`.
|
||||
|
||||

|
||||
|
||||
Gunakan fail lain dengan `python -m squirrel <fail banci> <fail ringkasan>`. Jika fail banci tidak wujud, program mencetak `Census file not found` dan keluar dengan status 2.
|
||||
|
||||
## Jalankan ujian
|
||||
|
||||
```bash
|
||||
python -m pytest
|
||||
```
|
||||
|
||||

|
||||
|
||||
## Bina dokumentasi sumber
|
||||
|
||||
```bash
|
||||
doxygen Doxyfile
|
||||
```
|
||||
|
||||
Buka `docs/doxygen/html/index.html`.
|
||||
@@ -0,0 +1,24 @@
|
||||
<!-- Generated from wiki; edit the source pages, not the published wiki. -->
|
||||
|
||||
**Squirrel Census**
|
||||
|
||||
**English**
|
||||
|
||||
- [Home](Home)
|
||||
- [Install](Install)
|
||||
- [Usage](Usage)
|
||||
- [Description](Description)
|
||||
|
||||
**Dansk**
|
||||
|
||||
- [Hjem](Home.da)
|
||||
- [Installation](Install.da)
|
||||
- [Brug](Usage.da)
|
||||
- [Beskrivelse](Description.da)
|
||||
|
||||
**Bahasa Melayu**
|
||||
|
||||
- [Utama](Home.ms)
|
||||
- [Pemasangan](Install.ms)
|
||||
- [Penggunaan](Usage.ms)
|
||||
- [Penerangan](Description.ms)
|
||||
Reference in New Issue
Block a user