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

Gaseous Pollutants #3146

Closed
wants to merge 3 commits into from
Closed

Gaseous Pollutants #3146

wants to merge 3 commits into from

Conversation

wabinyai
Copy link
Contributor

@wabinyai wabinyai commented Apr 15, 2024

WHAT DOES THIS PR DO?
Be able to export Gaseous Pollutants

  • Item 1
  • Item 2

WHAT ISSUES ARE RELATED TO THIS PR?

  • Jira cards
    • []
  • GitHub issues
    • Closes #

HOW DO I TEST OUT THIS PR?

WHICH ENDPOINTS SHOULD BE READY FOR TESTING?:

  • Endpoint 1
  • Endpoint 2

ARE THERE ANY RELATED PRs?

  • Related PR 1
  • Related PR 2

Summary by CodeRabbit

  • New Features
    • Added support for carbon monoxide (CO) and ammonia (NH3) pollutants in data processing, querying, and event retrieval.
    • Expanded pollutant categories to include CO and NH3 in various mappings and categories.
    • Updated data export capabilities to handle CO and NH3 pollutants.

Copy link

codecov bot commented Apr 15, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 30.45%. Comparing base (4676069) to head (1b0d1f6).
Report is 5544 commits behind head on staging.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff            @@
##           staging    #3146   +/-   ##
========================================
  Coverage    30.45%   30.45%           
========================================
  Files          184      184           
  Lines        24362    24362           
  Branches      3184     3184           
========================================
  Hits          7419     7419           
  Misses       16825    16825           
  Partials       118      118           

@wabinyai wabinyai self-assigned this Apr 15, 2024
@wabinyai wabinyai added work in progress priority-medium Indicates a medium priority issue labels Apr 15, 2024
Copy link
Contributor

Analytics changes in this PR available for preview here

Copy link
Contributor

Analytics changes in this PR available for preview here

Copy link
Contributor

@Baalmart Baalmart left a comment

Choose a reason for hiding this comment

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

thanks @wabinyai this sounds and looks like an important that should be getting timely reviews. cc: @Mnoble-19 / @sserurich

@@ -36,7 +36,7 @@ class EventsModel(BasePyMongoModel):
DEVICES_SUMMARY_TABLE = CONFIGURATIONS.DEVICES_SUMMARY_TABLE

def __init__(self, tenant):
Copy link
Contributor

Choose a reason for hiding this comment

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

Hi @wabinyai , thanks for this. Do these gases also follow the AQI?

@Baalmart
Copy link
Contributor

Hi @wabinyai , please check this PR and fix any merge conflicts that have just appeared. Thanks!

Copy link
Contributor

coderabbitai bot commented Jul 8, 2024

Walkthrough

Walkthrough

Recent updates have enhanced the handling of pollutants in the analytics API, specifically introducing support for "co" (carbon monoxide) and "nh3" (ammonia) in multiple areas including data processing, querying, and event retrieval. These changes extend the pollutant mappings, make modifications to the analytics models, and expand the list of pollutants in relevant resource classes.

Changes

File Path Change Summary
src/analytics/api/models/events.py Enhanced EventsModel methods to support "co" and "nh3" pollutants in data processing, querying, and event retrieval.
src/analytics/api/utils/pollutants/pm_25.py Added "co" and "nh3" mappings to unit, data status, frequency dictionaries, and pollutant categories.
src/analytics/api/views/data.py Expanded valid pollutants to include "voc", "co", and "nh3" in the DataExportResource and DataExportV2Resource classes' post methods.

Poem

As carbon meets ammonia in air,
Data we gather, insights we share.
From events to queries, pollutants align,
Expanding horizons, a new data sign.
In code, we whisper, in data, we find,
Clearer skies, a healthier mind.


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between dfd4a7a and 1b0d1f6.

Files selected for processing (3)
  • src/analytics/api/models/events.py (11 hunks)
  • src/analytics/api/utils/pollutants/pm_25.py (5 hunks)
  • src/analytics/api/views/data.py (2 hunks)
Additional comments not posted (19)
src/analytics/api/utils/pollutants/pm_25.py (8)

17-18: Verify parameter mappings for CO and NH3.

Ensure that the parameters for CO and NH3 are correct and align with the system's requirements.


27-28: Verify unit mappings for CO and NH3.

Ensure that the units for CO and NH3 are correct and align with the system's requirements.


35-41: Verify data status mappings for CO and NH3.

Ensure that the data status mappings for CO and NH3 are correct and align with the system's requirements.


52-53: Verify data status mappings for CO and NH3.

Ensure that the data status mappings for CO and NH3 are correct and align with the system's requirements.


68-69: Verify BigQuery mappings for CO and NH3.

Ensure that the BigQuery mappings for CO and NH3 are correct and align with the system's requirements.


77-78: Verify frequency mappings for CO and NH3.

Ensure that the frequency mappings for CO and NH3 are correct and align with the system's requirements.

Also applies to: 84-85, 91-92


136-144: Verify CO category mappings.

Ensure that the category mappings for CO are correct and align with the system's requirements.


146-154: Verify NH3 category mappings.

Ensure that the category mappings for NH3 are correct and align with the system's requirements.

src/analytics/api/views/data.py (2)

57-57: Verify valid pollutants for CO and NH3.

Ensure that the valid pollutants for CO and NH3 are correct and align with the system's requirements.


202-202: Verify valid pollutants for CO and NH3.

Ensure that the valid pollutants for CO and NH3 are correct and align with the system's requirements.

src/analytics/api/models/events.py (9)

39-39: Verify limit mappings for CO and NH3.

Ensure that the limit mappings for CO and NH3 are correct and align with the system's requirements.


98-105: Verify BigQuery pollutant columns for CO and NH3.

Ensure that the pollutant columns for CO and NH3 are correct and align with the system's requirements.


326-333: Verify BigQuery pollutant columns for CO and NH3.

Ensure that the pollutant columns for CO and NH3 are correct and align with the system's requirements.


766-767: Verify downloadable events fields for CO and NH3.

Ensure that the fields for CO and NH3 are correct and align with the system's requirements.

Also applies to: 779-779


822-822: Verify pollutant validation for CO and NH3.

Ensure that the pollutant validation for CO and NH3 is correct and aligns with the system's requirements.


844-844: Verify pollutant validation for CO and NH3.

Ensure that the pollutant validation for CO and NH3 is correct and aligns with the system's requirements.


867-867: Verify pollutant validation for CO and NH3.

Ensure that the pollutant validation for CO and NH3 is correct and aligns with the system's requirements.


1016-1016: Verify pollutant validation for CO and NH3.

Ensure that the pollutant validation for CO and NH3 is correct and aligns with the system's requirements.


1098-1099: Verify event fields for CO and NH3.

Ensure that the fields for CO and NH3 are correct and align with the system's requirements.

Also applies to: 1111-1112

@wabinyai wabinyai closed this Jan 9, 2025
@wabinyai wabinyai deleted the GaseousPollutants branch January 9, 2025 13:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority-medium Indicates a medium priority issue work in progress
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants