Skip to content

Issue 99 from url#101

Open
finozzifa wants to merge 10 commits into
prototype-2from
issue_99_from_url
Open

Issue 99 from url#101
finozzifa wants to merge 10 commits into
prototype-2from
issue_99_from_url

Conversation

@finozzifa

@finozzifa finozzifa commented Jun 25, 2026

Copy link
Copy Markdown
Member

Closes #99

Changes proposed in this Pull Request

Checklist

  • Code changes are sufficiently documented; i.e. new functions contain docstrings and further explanations may be given in doc.
  • Data source for new technologies is clearly stated.
  • Newly introduced dependencies are added to environment.yaml (if applicable).
  • A note for the release notes doc/release_notes.rst of the upcoming release is included.
  • I consent to the release of this PR's code under the GPLv3 license.

@finozzifa
finozzifa marked this pull request as ready for review June 26, 2026 08:43
@finozzifa
finozzifa requested a review from euronion June 26, 2026 08:43

@euronion euronion left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comments below

Comment on lines +206 to +207
>>> accessor = DataAccessor(data_source="dea_energy_storage", version="v1.0")
>>> dp = accessor.download("https://example.com/data")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unclear: Does this load the version from the specified URL, or does it use the information from data_source and version somehow?
What if those two are not specified?
What if those two are specified but the URL target is a different one?

Download and load technology data from a remote URL.

This method downloads technologies.json and sources.json files from the
specified base URL and loads them into a DataPackage instance. The sources.json

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The file is also stored somewhere, right? Add where / how it is stored.

Examples
--------
>>> accessor = DataAccessor(data_source="dea_energy_storage", version="v1.0")
>>> dp = accessor.download("https://example.com/data")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use a better URL for the example? e.g. just point at one of the data packages from this repository: https://raw.githubusercontent.com/open-energy-transition/technology-data/refs/heads/issue_99_from_url/src/technologydata/parsers/dea_energy_storage/v10/

Comment on lines +211 to +212
if not base_url.endswith("/"):
base_url += "/"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

assert dp.name == "manual_input_usa"
assert dp.version == "v0.13.4"
assert len(dp.sources) == 1
assert len(dp.technologies) == 85

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the test to work reliably, better to point to a static URL, rather than the branch's HEAD URL. Else the len(...) might change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants