Repository navigation
feat: order the columns of every DataFrame the same way - #33
Merged
Merged
Conversation
The columns followed the nesting of the JSON of each endpoint, so some tables started with the zone and others with the type, what identifies a series was mixed with the quality of the data, and the unit was far from the value. Every DataFrame now has first when (timestamp, or start and end for an aggregate), then what the series is (zone, the other zone of a flow, the type and the scope), then value and unit, then the quality and the provenance of the data in the order of the API, and updated_at last. source is the other zone only next to a zone; in the factors it is where the factor comes from. The example notebook asks the factors with the same window as the other cells (without a range the API answered with the current interval, empty until it is published) and is run again with the new order.
Welcome to Codecov 🎉Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests. ℹ️ You can also turn on project coverage checks and project coverage reporting on Pull Request comment Thanks for integrating Codecov - We've got you covered ☂️ |
The client is published as 1.0.0 for a stable API, as wattnet-api, wattnet-storage and wattnet-core already declare.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
flatten.order_columnsgives every DataFrame the same column order:timestamp, orstartandendfor an aggregate.zone, the other zone of a flow (source,destination,origin), the type (production_type,footprint_type,impact_type,factor_type) andscope.valueandunit.valid,zone_status,data_state,datasource,coverage...), in the order of the API.updated_at.sourceis the other zone only next to azone; in the factors it is where the factor comes from (UNECE) and stays with the provenance.get_zonesandget_statuskeep their columns.Example:
get_generationgoes fromzone, unit, valid, zone_status, production_type, data_state, datasource, timestamp, value, updated_attotimestamp, zone, production_type, value, unit, valid, zone_status, data_state, datasource, updated_at.Why
The order followed the nesting of the JSON of each endpoint: some tables started with the zone and others with the type, what identifies a series was mixed with the quality of the data, and the unit was far from the value. The client is not published yet, so the order can change now without breaking anyone.
Also
The example notebook asks the factors with the same 6-hour window as the other cells (without a range the API answered with the current interval, empty until it is published; wattnet/wattnet-api#63 fixes that) and is run again against the API with the new order: every cell has its output.
Tests
sourcein the factors and next to a zone.toxgreen, coverage 100%.