Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EEA reader #44

Merged
merged 23 commits into from
Sep 5, 2024
Merged

EEA reader #44

merged 23 commits into from
Sep 5, 2024

Conversation

dulte
Copy link
Collaborator

@dulte dulte commented Jul 25, 2024

No description provided.

@dulte dulte requested a review from heikoklein August 30, 2024 13:45
@dulte dulte self-assigned this Aug 30, 2024
@dulte dulte added the enhancement New feature or request label Aug 30, 2024
@dulte dulte added this to the m2024-09 milestone Aug 30, 2024
@dulte
Copy link
Collaborator Author

dulte commented Aug 30, 2024

Still to be done:

  1. Add documentation, especially for the folder structure the reader expects the data to have
  2. Remove typer. I added typer cli functionality to the downloader. But that is a bit overkill. Remove it to make fewer dependencies. I've not added typer to setup.cfg, eventhough the downloader needs it, since I will remove typer from the downloader
  3. Toml is a dependency, which is only used by the downloader. So if the downloading is moved out of the repo, then toml can be removed as a dependency

Copy link
Member

@heikoklein heikoklein left a comment

Choose a reason for hiding this comment

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

Thanks for the implementation. Please use std-python libs or existing dependencies unless really required and discussed elsewhere.

I think metadata should be part of the data-download, not part of this reader. See the existing database at: /lustre/storeB/project/aerocom/aerocom1/AEROCOM_OBSDATA/EEA_AQeRep.v2/download

The test-database is much too big. Please shrink it to ~100k in total. Some files have more than 1MB.

setup.cfg Outdated Show resolved Hide resolved
src/pyaro_readers/eeareader/eeadownloader.py Show resolved Hide resolved
src/pyaro_readers/eeareader/data.toml Show resolved Hide resolved
src/pyaro_readers/eeareader/eeadownloader.py Outdated Show resolved Hide resolved
src/pyaro_readers/eeareader/eeadownloader.py Show resolved Hide resolved
with open("concentration.csv") as source:
response = []
for line in source:
words = line.split(",")
Copy link
Member

Choose a reason for hiding this comment

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

consider using csv module with DictReader. Much easier to read line["Sampling Point Id"] than words[0].

separator seems to be ", "

@dulte
Copy link
Collaborator Author

dulte commented Sep 5, 2024

PR metno/pyaerocom#1335 must also be merge before the reader works with aeroval

@heikoklein heikoklein self-requested a review September 5, 2024 12:11
Copy link
Member

@heikoklein heikoklein left a comment

Choose a reason for hiding this comment

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

Looks very good. A small comment on tomli and python-version.

And a big question: The times in the parquet files are (EEA-specification) given in UTC+1, not UTC. pyaro expects times in UTC. Do you convert?

from pathlib import Path


import tomli as tomllib
Copy link
Member

Choose a reason for hiding this comment

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

this should have a version test since tomllib is include >= python 3.11

@dulte dulte marked this pull request as ready for review September 5, 2024 12:21
@heikoklein heikoklein changed the title First small steps towards eea reader eea reader Sep 5, 2024
@heikoklein heikoklein changed the title eea reader EEA reader Sep 5, 2024
if sys.version_info.minor >= 11:
import tomllib
else:
import tomli as tomllib
Copy link
Member

Choose a reason for hiding this comment

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

if sys.version_info >= (3, 11):
    import tomllib
else:
    import tomli as tomllib

or more pragmatic:

try:
    import tomllib
except ImportError:
    import tomli as tomllib

@heikoklein heikoklein merged commit 80f5a1f into main-dev Sep 5, 2024
4 checks passed
@heikoklein heikoklein deleted the eeareader branch September 5, 2024 13:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants