Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
4f3d359
dev: Use cases, design and context
euronion Jul 1, 2025
b099964
code: initial new package structure (#13)
finozzifa Jul 21, 2025
617dce4
Extend Technology and TechnologyCollection (#14)
finozzifa Jul 28, 2025
506f17f
config: add pytest-xdist and pytest-cov (#16)
finozzifa Jul 28, 2025
3f69fb1
Unit-ful parameter (#15)
euronion Jul 31, 2025
105578b
code: add OOP to test suites (#21)
finozzifa Jul 31, 2025
fe3cfcc
code: Switch to src layout
euronion Aug 18, 2025
0f0b43a
code: update unit test in test_source.py
finozzifa Aug 19, 2025
69c8f96
Make development dependencies optional (#34)
euronion Aug 21, 2025
6dcd24a
code: Harmonise type hints (#36)
euronion Aug 21, 2025
1a1ae6b
code: Allow parameter mul and div with scalars (#37)
euronion Aug 28, 2025
a67d379
Solve issues in test_sources.py (#40)
finozzifa Sep 9, 2025
c1e4936
Issue 24: LHV and HHV (#39)
finozzifa Sep 15, 2025
0d15d3e
skip tests that usually fail (#41)
finozzifa Sep 16, 2025
9c6aadc
Prototype documentation - v1 (#38)
finozzifa Sep 16, 2025
0527655
Add history 'master' of https://github.com/PyPSA/technology-data into…
euronion Sep 22, 2025
b8b5e3f
Merge pull request #47 from open-energy-transition/pre-prototype-2
euronion Sep 23, 2025
938bf33
doc: Remove copy-pasta mistake from pypsa-docs
euronion Sep 23, 2025
1c0d014
doc: Use uv for RTD building
euronion Sep 23, 2025
899d8fa
code: modify target branch for ci triggering (#52)
finozzifa Sep 24, 2025
6fc7dd4
Issue 42 harmonize units (#51)
finozzifa Sep 25, 2025
6816997
Turn Source.store_in_wayback into a private method (#63)
finozzifa Oct 8, 2025
3f1027a
update from_json and to_json methods for TechnologyCollection and Sou…
finozzifa Oct 10, 2025
9e21b52
code: Reorder Technology attributes (#66)
euronion Oct 20, 2025
c9b39ba
31 change currency technology collection (#69)
euronion Oct 28, 2025
b8ad714
Custom error message for CCC_YYYY (#72)
finozzifa Nov 3, 2025
9a656ef
Technology collection models (#18)
euronion Nov 5, 2025
7f9bdea
Docs readme (#75)
euronion Nov 6, 2025
06d3f5f
code: skip three more unit tests (#76)
finozzifa Nov 6, 2025
6234d83
Make output schema of `SourceCollection` and `TechnologyCollection` o…
finozzifa Nov 18, 2025
471b617
Prototest DEA (#57)
finozzifa Nov 19, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .codespell.ignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# SPDX-FileCopyrightText: The technology-data authors
#
# SPDX-License-Identifier: MIT
CAF
26 changes: 0 additions & 26 deletions .github/ISSUE_TEMPLATE/bug_report.md

This file was deleted.

5 changes: 0 additions & 5 deletions .github/ISSUE_TEMPLATE/config.yml

This file was deleted.

15 changes: 0 additions & 15 deletions .github/ISSUE_TEMPLATE/feature_request.md

This file was deleted.

14 changes: 0 additions & 14 deletions .github/dependabot.yml

This file was deleted.

44 changes: 44 additions & 0 deletions .github/instructions/copilot-instructions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Copilot Coding Agent Instructions for `technologydata`

<!--
SPDX-FileCopyrightText: The technology-data authors

SPDX-License-Identifier: MIT

-->

## Project Overview
- `technologydata` is a Python package for energy system modellers to screen, harmonize, and transform techno-economic input data for energy system models.
- Major use cases: data validation, harmonization, transformation to model-ready formats, and provenance/audit tracing.
- Core classes: `DataPackage`, `Technology`, `Parameter`, `Source`, and `SourceCollection` (see `technologydata/`).
- Data flows: Input data (JSON or DataFrame) → `DataPackage`/`Technology` objects → validation/transformation → output for modeling/analysis.

## Key Workflows
- **Install dependencies:** Use `uv` (see `pyproject.toml`, `uv.lock`). Example: `uv sync`.
- **Activate virtual environment:** Use `source .venv/bin/activate` before running commands.
- **Linting/formatting:** Use `ruff` (`ruff check .` and `ruff format .`).
- **Type checking:** Use `mypy`.
- **Testing:** Use `pytest` (tests in `test/`). Fixtures in `test/conftest.py`. Run: `pytest`.
- **Pre-commit hooks:** Set up with `pre-commit` using `.pre-commit-config.yaml`, use this preferably over using `mypy` and `ruff` manually.
- **Docs:** Built with `mkdocs` (see `docs/`).

## Project-Specific Patterns
- **Validation:** Instantiating `Technology` or `DataPackage` triggers schema validation. Use `.check_consistency()` and `.calculate_parameters()` for further checks and derivations.
- **Parameter Derivation:** Use `.calculate_parameters()` to fill in missing values based on rules.
- **Unit Handling:** Uses `pint` for units and `pydeflate` for currency/inflation adjustments. Custom `UnitRegistry` in `technologydata/utils/units.py`.
- **Data Provenance:** Each `Parameter` and `Technology` tracks its source and transformation history.
- **Data Input:** Prefer JSON conforming to the internal schema. See `test/test_data/` for examples.

## External Integrations
- `pydeflate` for currency/inflation
- `pint` for units
- `hdx.location.country` for country/currency codes
- `savepagenow` for web archiving

## References
- Design: `docs/design.md`
- Class diagram: `docs/class-diagram.puml`
- Example data: `test/test_data/`

---
If any conventions or workflows are unclear, please ask for clarification or check `docs/design.md` for rationale and details.
12 changes: 0 additions & 12 deletions .github/pull_request_template.md

This file was deleted.

73 changes: 25 additions & 48 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,64 +1,41 @@
name: CI
# SPDX-FileCopyrightText: The technology-data authors
#
# SPDX-License-Identifier: MIT
name: Technologydata prototype CI

on:
push:
branches: [master]
branches: [prototype-2]
pull_request:
branches: [master]
schedule:
- cron: "0 5 * * 0"


# Cancel any in-progress runs when a new run is triggered
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
branches: [prototype-2]

jobs:
build:
name: CI
test:
runs-on: ubuntu-latest

defaults:
run:
shell: bash -l {0}

steps:
- name: Checkout code
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup micromamba
uses: mamba-org/setup-micromamba@v2

- name: Set up Python
uses: actions/setup-python@v5
with:
micromamba-version: latest
environment-file: environment.yaml
log-level: debug
init-shell: bash
cache-environment: true
cache-downloads: true
python-version: "3.13"

- name: Run unit tests
- name: Cache Python dependencies
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/uv.lock') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install package and dependencies
run: |
make unit-test
python -m pip install uv
uv lock
uv sync

- name: Test snakemake workflows
- name: Run unit tests
run: |
make test

- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: technology-data
path: outputs/

- name: Check for differences in generated outputs
run: |-
git config --global --add safe.directory $GITHUB_WORKSPACE
git add outputs/
if ! git diff --cached --quiet; then
echo "Generated outputs differ from the branch. Please commit rerun `snakemake` and commit the changes to the `outputs/*.csv` files."
git diff --cached
exit 1
else
echo "No differences found in generated outputs."
fi
uv run pytest
97 changes: 74 additions & 23 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,26 +1,77 @@
# SPDX-FileCopyrightText: Contributors to technology-data <https://github.com/pypsa/technology-data>
# SPDX-FileCopyrightText: The technology-data authors
#
# SPDX-License-Identifier: GPL-3.0-only
# SPDX-License-Identifier: MIT

# Byte-compiled / optimized / DLL files
*__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
*.egg-info/
.installed.cfg
*.egg

# Virtual environments
.env/
.venv/
env/
venv/
ENV/
env.bak/
venv.bak/

# PyInstaller
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
.hypothesis/
.pytest_cache/

# PyCharm
.idea/

# VS Code
.vscode/

# macOS
.DS_Store
.snakemake
_build
.idea
.vscode
gurobi.log
*.log
*/__pycache__

## Core latex/pdflatex auxiliary files:
*.aux
*.lof
*.log
*.lot
*.fls
*.out
*.toc
*.fmt
*.fot
*.cb
*.cb2
.*.lb

# Jupyter Notebook
.ipynb_checkpoints/

# mypy
.mypy_cache/
.dmypy.json

# folder for misc developments
dev/
22 changes: 0 additions & 22 deletions .gitignore.save

This file was deleted.

Loading