AQ-AI / openaq-engine

http://www.aqai.xyz
BSD 3-Clause "New" or "Revised" License
2 stars 0 forks source link

41 ingesting from api rather than aws #42

Closed ChristinaLast closed 1 year ago

ChristinaLast commented 1 year ago

Description

This PR achieves the following features:

Options: -d, --latest-date TEXT Date to load data until in format YYYY-MM-DD -p, --pollutant [co|no2|o3|pm1|pm10|pm25|so2] Load timesplits from data for the pollutant requested -s, --source [openaq-aws|openaq-api] Source to load the openaq data from -c, --country TEXT Load timesplits from specific countries Options for defining time-splitter: Allows definition of custom timesplits for provided countries and from the date provided --help Show this message and exit.


- [X] Adds querying results from openaq's API rather than just the AWS to prove platform independence
- [x] refactors naming to decouple from one data provider

Fixes #41 

## Type of change

Please delete options that are not relevant.

- [X] New feature (non-breaking change which adds functionality)
- [X] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [X] This change requires a documentation update

# How has this been tested?

Please describe the tests that you ran to verify your changes.

Load the CLI:
go into the course code dir:

cd openaq_engine

Remove any previous `__pycache__` folders or `openaq-engine.egg.info` files. Then run the following line:

pip install -e .

This should build the package locally
then 

cd ..

and then try to run the CLI

openaq-engine time-splitter --help


# Checklist:

- [x] My code follows the style guidelines of this project
- [X] I have performed a self-review of my own code
- [X] I have commented my code, particularly in hard-to-understand areas
- [X] I have made corresponding changes to the documentation
- [x] My changes generate no new warnings
jit-1 commented 1 year ago
[prithviraj@ip-172-31-81-98 openaq-engine]$ poetry shell
Spawning shell within /home/prithviraj/unicef/openaq-engine/.venv
. /home/prithviraj/unicef/openaq-engine/.venv/bin/activate
[prithviraj@ip-172-31-81-98 openaq-engine]$ . /home/prithviraj/unicef/openaq-engine/.venv/bin/activate
(openaq-engine-py3.8) [prithviraj@ip-172-31-81-98 openaq-engine]$ openaq-engine time-splitter --help
Traceback (most recent call last):
  File "/home/prithviraj/unicef/openaq-engine/.venv/bin/openaq-engine", line 33, in <module>
    sys.exit(load_entry_point('openaq-engine', 'console_scripts', 'openaq-engine')())
  File "/home/prithviraj/unicef/openaq-engine/.venv/bin/openaq-engine", line 25, in importlib_load_entry_point
    return next(matches).load()
StopIteration
jit-1 commented 1 year ago
(openaq-engine-py3.8) [prithviraj@ip-172-31-81-98 openaq-engine]$ poetry shell
Virtual environment already activated: /home/prithviraj/unicef/openaq-engine/.venv
(openaq-engine-py3.8) [prithviraj@ip-172-31-81-98 openaq-engine]$ poetry install
Installing dependencies from lock file

No dependencies to install or update

Installing the current project: openaq-engine (0.1.0)
(openaq-engine-py3.8) [prithviraj@ip-172-31-81-98 openaq-engine]$ openaq-engine time-splitter --help
Traceback (most recent call last):
  File "/home/prithviraj/unicef/openaq-engine/.venv/bin/openaq-engine", line 33, in <module>
    sys.exit(load_entry_point('openaq-engine', 'console_scripts', 'openaq-engine')())
  File "/home/prithviraj/unicef/openaq-engine/.venv/bin/openaq-engine", line 25, in importlib_load_entry_point
    return next(matches).load()
StopIteration
(openaq-engine-py3.8) [prithviraj@ip-172-31-81-98 openaq-engine]$