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

refactor: upgrade CA-NS with event classes #6050

Merged
merged 15 commits into from
Feb 10, 2024

Commits on Oct 25, 2023

  1. refactor: upgrade CA-NS with event classes

    Upgrade the parser to use the ExchangeList, ProductionBreakdownList,
    ProductionMix, and ZoneKey classes. This should yield no functional
    change. Additionally:
    
    - Comply with Black's 88-column default line length limit.
    - Define global constants to replace a number of local variables and
      literals.
    - Try to use more consistent names throughout.
    
    Refs: electricitymaps#6011, electricitymaps#6050
    kruschk committed Oct 25, 2023
    Configuration menu
    Copy the full SHA
    459e1cf View commit details
    Browse the repository at this point in the history
  2. refactor: zip arrays together instead of searching

    The JSON arrays a and b returned by the two endpoints appear to be
    parallel in the sense that element a[i] corresponds with element b[i]
    for all i of interest. Zip these arrays together and iterate over the
    resulting pairs instead of iterating over one and performing a linear
    search to find the corresponding element in the other. Additionally:
    
    - Check whether we've been bitten by a race condition while requesting
      the above array data and bail out if so.
    - Skip the first element of each array because the reported base load is
      always 0 MW.
    
    Refs: electricitymaps#6011, electricitymaps#6050
    kruschk committed Oct 25, 2023
    Configuration menu
    Copy the full SHA
    0de7079 View commit details
    Browse the repository at this point in the history

Commits on Oct 26, 2023

  1. feat: retry requests and simplify validation

    - When a pair of requests have failed, retry them until they succeed or
      the maximum number of attempts is exceeded.
    - Simplify the validation logic by making better use of the event
      classes instead of introducing extraneous data structures.
    
    Refs: electricitymaps#6011, electricitymaps#6050
    kruschk committed Oct 26, 2023
    Configuration menu
    Copy the full SHA
    9be429a View commit details
    Browse the repository at this point in the history

Commits on Nov 4, 2023

  1. refactor: reliably correlate loads with mixes

    Reliably merge the source's base load array with the corresponding
    electricity mix array by correlating events based on their timestamps.
    
    Refs: electricitymaps#6011, electricitymaps#6050
    kruschk committed Nov 4, 2023
    Configuration menu
    Copy the full SHA
    6eb5409 View commit details
    Browse the repository at this point in the history

Commits on Nov 26, 2023

  1. fix: remove percentage limits and add defaults

    - Stop discarding events whose production mix percentages exceed
      percentage thresholds, as these imposed limits may not be sound.
    - Provide defaults when getting attributes from the production mix to
      avoid comparing numbers with Nones.
    
    Refs: electricitymaps#6011, electricitymaps#6050
    kruschk committed Nov 26, 2023
    Configuration menu
    Copy the full SHA
    5f96eeb View commit details
    Browse the repository at this point in the history

Commits on Jan 14, 2024

  1. feat: upgrade NS parser with NB and NL exchanges

    - New Brunswick and Newfoundland and Labrador exchange data is available
      at https://www.nspower.ca/oasis/system-reports-messages/daily-report;
      upgrade the exchange parser to leverage this new source.
    - Since it no longer reduces duplication, eliminate the _get_info
      function and roll its logic into fetch_production.
    
    Refs: electricitymaps#2541, electricitymaps#3206, electricitymaps#6011, electricitymaps#6050, electricitymaps#6317
    kruschk committed Jan 14, 2024
    Configuration menu
    Copy the full SHA
    3be20e5 View commit details
    Browse the repository at this point in the history

Commits on Jan 27, 2024

  1. Merge remote-tracking branch 'upstream/master' into kruschk/6011-ca-ns

    Apply the following corrections and merge conflic resolutions:
    
    - Fix an incorrect zone in a call to fetch_exchange.
    - Treat CT generation as oil instead of gas.
    - Update the comment regarding hydro capacities.
    - Update the production mix thresholds for hydro and oil.
    kruschk committed Jan 27, 2024
    Configuration menu
    Copy the full SHA
    b57a69d View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    dc2b5ce View commit details
    Browse the repository at this point in the history

Commits on Jan 31, 2024

  1. feat: handle potential HTML-navigation errors

    Gracefully handle errors that might occur while navigating the HTML
    document containing exchange data.
    
    Refs: electricitymaps#6011
    kruschk committed Jan 31, 2024
    Configuration menu
    Copy the full SHA
    4b60fc8 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    c5162a7 View commit details
    Browse the repository at this point in the history

Commits on Feb 1, 2024

  1. fix: correct (and improve) error handling

    - Re-throw caught errors to provide better diagnostic information.
    - Format log messages lazily.
    
    Refs: electricitymaps#6011
    kruschk committed Feb 1, 2024
    Configuration menu
    Copy the full SHA
    792e490 View commit details
    Browse the repository at this point in the history

Commits on Feb 3, 2024

  1. Configuration menu
    Copy the full SHA
    a1de3cb View commit details
    Browse the repository at this point in the history
  2. Merge remote-tracking branch 'upstream/master' into kruschk/6011-ca-ns

    Add a check for 0 MW base loads to resolve the merge conflict.
    
    Refs: electricitymaps#6011, electricitymaps#6440
    kruschk committed Feb 3, 2024
    Configuration menu
    Copy the full SHA
    96a5b6c View commit details
    Browse the repository at this point in the history

Commits on Feb 6, 2024

  1. Configuration menu
    Copy the full SHA
    65a4769 View commit details
    Browse the repository at this point in the history

Commits on Feb 10, 2024

  1. Configuration menu
    Copy the full SHA
    8ba6905 View commit details
    Browse the repository at this point in the history