Skip to content

Releases: CodeForAfrica/sensors.AFRICA-api

v0.4.9

02 Mar 15:11
Compare
Choose a tag to compare

Hotfix remove temp file if exists when running upload_to_ckan command.

FAILURE -- archive_data
Name: sensorsafrica.tasks.archive_data
Execution time: 1 minutes 46 seconds
Task ID: 0e7f794b-f13d-41f8-8636-ea1c60520731
args: []
kwargs: {}
Exception: [Errno 2] No such file or directory: '/tmp/january_2020_sensor_data_archive.csv'
Info:
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/celery/app/trace.py", line 382, in trace_task
    R = retval = fun(*args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/celery/app/trace.py", line 641, in __protected_call__
    return self.run(*args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/sentry_sdk/integrations/celery.py", line 66, in _inner
    reraise(*_capture_exception())
  File "/usr/local/lib/python3.6/site-packages/sentry_sdk/_compat.py", line 44, in reraise
    raise value
  File "/usr/local/lib/python3.6/site-packages/sentry_sdk/integrations/celery.py", line 64, in _inner
    return f(*args, **kwargs)
  File "/src/sensorsafrica/tasks.py", line 12, in archive_data
    call_command("upload_to_ckan")
  File "/usr/local/lib/python3.6/site-packages/django/core/management/__init__.py", line 131, in call_command
    return command.execute(*args, **defaults)
  File "/usr/local/lib/python3.6/site-packages/django/core/management/base.py", line 330, in execute
    output = self.handle(*args, **options)
  File "/src/sensorsafrica/management/commands/upload_to_ckan.py", line 106, in handle
    os.remove(filepath)
FileNotFoundError: [Errno 2] No such file or directory: '/tmp/january_2020_sensor_data_archive.csv'

v0.4.8

05 Feb 06:03
2aae828
Compare
Choose a tag to compare

BUG FIX

  • Make the query for the last active sensor to be faster so that the lastactive sensors show up on the map faster and in the /v2/nodes query

v0.4.7

28 Jan 09:14
Compare
Choose a tag to compare

Introduce CKAN_ARCHIVE_* variables

v0.4.6

11 Oct 05:53
7903dbf
Compare
Choose a tag to compare

Introduce missing code/functionality for the following routes.

  • /v1/sensors/{sensor_id}/ - all measurements of the last 5 minutes for one sensor
  • /v1/filter?city=&country=&type= - 5 minutes filtered by query
  • /static/v2/data.json - average of all measurements per sensor of the last 5 minutes for all sensors
  • /static/v2/data.1h.json - average of all measurements per sensor of the last hour
  • /static/v2/data.24h.json - average of all measurements per sensor of the 24 hours
  • static/v2/data.dust.min.json - same as data.json but dust sensors only
  • /static/v2/data.temp.min.json - same as data.json but temp

v0.4.5

10 Sep 08:38
255b49d
Compare
Choose a tag to compare

Added environment variable SENSORSAFRICA_CELERY_SLACK_WEBHOOK_FAILURES_ONLY to allow setup of celery slack to only send out failures if needed.

v0.4.4

04 Sep 09:32
Compare
Choose a tag to compare
  • Slack notifications on the celery background tasksSENSORSAFRICA_CELERY_SLACK_WEBHOOK
  • Push to open Africa archive openAFRICA_API_KEY openAFRICA_CFA_ID https://africaopendata.org
  • Revert public users to see data past 3 months only so now they can see all data.
  • last_data_received_at should be based on last sent PM sensor data
  • Admin tweaks

v0.4.3

28 May 12:52
Compare
Choose a tag to compare

Changed the returned property names for /v2/nodes:

  • prev_location --> moved_to since the previous_location is actually the location the node has moved_to.
  • added the node id and uid for faster identification
  • fix get sensors belonging to node id
  • prev_location is actually new_location/current_location
  • refactor and comments
  • fix typos

v0.4.2

20 May 09:28
e03b294
Compare
Choose a tag to compare
  • Routes to get all nodes that are active and inactive .i.e /v2/nodes
    • Also returns information if sensor moved locations
    • Also returns last 5 mins stats information i.e. average, min, max
  • Added task to cache last active sensors every 5 mins.

API v0.4.1

16 Apr 05:48
Compare
Choose a tag to compare

Fix archive data background task to use temp folder.

API v0.4.0

03 Apr 09:34
2ddd656
Compare
Choose a tag to compare
  • Celery controls the creation and execution of cron jobs
  • Flower web interface to see an configure jobs