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

CLI: get-openaq #270

Merged
merged 16 commits into from
Nov 5, 2024
Merged

CLI: get-openaq #270

merged 16 commits into from
Nov 5, 2024

Conversation

zmoon
Copy link
Collaborator

@zmoon zmoon commented Sep 11, 2024

Note that this uses noaa-oar-arl/monetio#141 (merged into monetio develop 2024-Sep-19)

  • add a test or two
  • add reference-grade / low-cost flags

@zmoon
Copy link
Collaborator Author

zmoon commented Sep 11, 2024

@jordanschnell , example one day command for you to try:

melodies-monet get-openaq -s 2024-09-10 -e '2024-09-10 23:00' -p o3 -p pm25 -p pm10 -p co -p no2 --verbose --debug -n 4

If you don't already have one, register for OpenAQ API key and then set the environment variable OPENAQ_API_KEY and the tool will use it.

The -n 4 means it will use 4 threads when gathering data. Adding too many more won't help, as there is rate limiting per API key. But having a few threads does make it faster, I've found.

@zmoon
Copy link
Collaborator Author

zmoon commented Sep 23, 2024

@jordanschnell The reader logs some messages related to the API calls that should shed some light into how much it is timing out (you can see the individual web API calls and when they get rate limited). I've set up an env var you can use to enable this: MM_LOGGING_LEVEL (use value debug or info).

still just reference-grade by default

to get just low-cost, have to use two flags:
--no-reference-grade --low-cost
@zmoon
Copy link
Collaborator Author

zmoon commented Oct 18, 2024

I added individual flags for the two sensor types (reference-grade and low-cost). But this could also be done like the params are, with a type flag that could be repeated (perhaps -t/--sensor-type).

@zmoon zmoon marked this pull request as ready for review October 23, 2024 16:10
@zmoon zmoon requested a review from rschwant October 25, 2024 18:35
Copy link
Collaborator

@jordanschnell jordanschnell left a comment

Choose a reason for hiding this comment

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

All is working well - approved.

melodies_monet/_cli.py Outdated Show resolved Hide resolved
melodies_monet/_cli.py Outdated Show resolved Hide resolved
@zmoon zmoon merged commit ad184bf into NOAA-CSL:develop Nov 5, 2024
5 checks passed
@zmoon zmoon deleted the cli-openaq branch November 5, 2024 22:17
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