-
Notifications
You must be signed in to change notification settings - Fork 0
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 root_validator to model_validator #37
Merged
Merged
Conversation
This file contains 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
Lkruitwagen
approved these changes
Feb 13, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good!
Lkruitwagen
pushed a commit
that referenced
this pull request
Feb 17, 2024
Lkruitwagen
added a commit
that referenced
this pull request
Feb 22, 2024
* tests: base oseomosys construction * feat: improvement to base abstraction * feat: add validation for time_defintion * tests: for time_definition * add test_otoole_roundtrip pytest * [SMS-239] cleanup noqa test data (#36) * fix: rm otoole sample data from tests * feat: import utils by name * fix: cleanup some DS store * fix: import utils * Refactor root_validator to model_validator (#37) * tests: otoole_roundtrip * feat: fitler pandas=3. dep warning * tests: roundtrip otoole timedefn * delint * otoole_roundtrip as pytest * fix: rename otoole-csv paths * fix: make long_name and description optional * tests: skip full otoole construction for now * Correct name on test_timedefinition_construction_failcases() * docs: clarify any-of * docs: clarify objects * testing: delint --------- Co-authored-by: edwardxtg <edwardxtg@gmail.com> Co-authored-by: edwardxtg <71764756+edwardxtg@users.noreply.github.com>
Lkruitwagen
added a commit
that referenced
this pull request
Feb 23, 2024
* tests: base oseomosys construction * feat: improvement to base abstraction * feat: add validation for time_defintion * tests: for time_definition * add test_otoole_roundtrip pytest * [SMS-239] cleanup noqa test data (#36) * fix: rm otoole sample data from tests * feat: import utils by name * fix: cleanup some DS store * fix: import utils * Refactor root_validator to model_validator (#37) * tests: otoole_roundtrip * feat: fitler pandas=3. dep warning * tests: roundtrip otoole timedefn * delint * otoole_roundtrip as pytest * fix: rename otoole-csv paths * fix: make long_name and description optional * tests: skip full otoole construction for now * tests: test region construction * feat: make base osemosys data built from args[0] * fix: rm composable assumptions and targets for now * fix: accidental rename * fix: accident rename test case * fix: rebase duplicate * tests: skip model construction for now --------- Co-authored-by: edwardxtg <edwardxtg@gmail.com> Co-authored-by: edwardxtg <71764756+edwardxtg@users.noreply.github.com>
Lkruitwagen
added a commit
that referenced
this pull request
Feb 23, 2024
* tests: base oseomosys construction * feat: improvement to base abstraction * feat: add validation for time_defintion * tests: for time_definition * add test_otoole_roundtrip pytest * [SMS-239] cleanup noqa test data (#36) * fix: rm otoole sample data from tests * feat: import utils by name * fix: cleanup some DS store * fix: import utils * Refactor root_validator to model_validator (#37) * tests: otoole_roundtrip * feat: fitler pandas=3. dep warning * tests: roundtrip otoole timedefn * delint * otoole_roundtrip as pytest * fix: rename otoole-csv paths * fix: make long_name and description optional * tests: skip full otoole construction for now * tests: test region construction * feat: make base osemosys data built from args[0] * fix: rm composable assumptions and targets for now * fix: accidental rename * fix: accident rename test case * tests: commodity construction and compatability * feat: begin refactor to /compat * feat: add 'isnumeric' helper util * refactor: defaults to initial import, don't import pydatnic schemas * refactor: defaults and compat * feat: commodity schema * More descriptive commodity validation error message * Add descriptions to commodity failing test data * tests: cleanup --------- Co-authored-by: edwardxtg <edwardxtg@gmail.com> Co-authored-by: edwardxtg <71764756+edwardxtg@users.noreply.github.com>
Lkruitwagen
added a commit
that referenced
this pull request
Feb 23, 2024
* tests: base oseomosys construction * feat: improvement to base abstraction * feat: add validation for time_defintion * tests: for time_definition * add test_otoole_roundtrip pytest * [SMS-239] cleanup noqa test data (#36) * fix: rm otoole sample data from tests * feat: import utils by name * fix: cleanup some DS store * fix: import utils * Refactor root_validator to model_validator (#37) * tests: otoole_roundtrip * feat: fitler pandas=3. dep warning * tests: roundtrip otoole timedefn * delint * otoole_roundtrip as pytest * fix: rename otoole-csv paths * fix: make long_name and description optional * tests: skip full otoole construction for now * tests: test region construction * feat: make base osemosys data built from args[0] * fix: rm composable assumptions and targets for now * fix: accidental rename * fix: accident rename test case * tests: commodity construction and compatability * feat: begin refactor to /compat * feat: add 'isnumeric' helper util * refactor: defaults to initial import, don't import pydatnic schemas * refactor: defaults and compat * feat: commodity schema * feat: make data construction more flexible * feat: build and test impact construction * tests: impact otoole roundtrip * fix: some cleanup on commodity testing * Description for impact fail test cases * add id to impact validation * fix: catch nested data on construction --------- Co-authored-by: edwardxtg <edwardxtg@gmail.com> Co-authored-by: edwardxtg <71764756+edwardxtg@users.noreply.github.com>
Lkruitwagen
added a commit
that referenced
this pull request
Feb 29, 2024
* tests: base oseomosys construction * feat: improvement to base abstraction * feat: add validation for time_defintion * tests: for time_definition * add test_otoole_roundtrip pytest * [SMS-239] cleanup noqa test data (#36) * fix: rm otoole sample data from tests * feat: import utils by name * fix: cleanup some DS store * fix: import utils * Refactor root_validator to model_validator (#37) * tests: otoole_roundtrip * feat: fitler pandas=3. dep warning * tests: roundtrip otoole timedefn * delint * otoole_roundtrip as pytest * fix: rename otoole-csv paths * fix: make long_name and description optional * tests: skip full otoole construction for now * tests: test region construction * feat: make base osemosys data built from args[0] * fix: rm composable assumptions and targets for now * fix: accidental rename * fix: accident rename test case * tests: commodity construction and compatability * feat: begin refactor to /compat * feat: add 'isnumeric' helper util * refactor: defaults to initial import, don't import pydatnic schemas * refactor: defaults and compat * feat: commodity schema * feat: make data construction more flexible * feat: build and test impact construction * tests: impact otoole roundtrip * fix: some cleanup on commodity testing * tests: touchup test-impact * tests: technology construction * feat: otoole compatability for technology * feat: add to defaults * feat: region and impact compat * feat: validation for technology * Add failing test case descriptions * update validation utils check_min_vals_lower_max() to handle single values. * fix: merge mistakes --------- Co-authored-by: edwardxtg <edwardxtg@gmail.com> Co-authored-by: edwardxtg <71764756+edwardxtg@users.noreply.github.com>
Lkruitwagen
added a commit
that referenced
this pull request
Feb 29, 2024
* tests: base oseomosys construction * feat: improvement to base abstraction * feat: add validation for time_defintion * tests: for time_definition * add test_otoole_roundtrip pytest * [SMS-239] cleanup noqa test data (#36) * fix: rm otoole sample data from tests * feat: import utils by name * fix: cleanup some DS store * fix: import utils * Refactor root_validator to model_validator (#37) * tests: otoole_roundtrip * feat: fitler pandas=3. dep warning * tests: roundtrip otoole timedefn * delint * otoole_roundtrip as pytest * fix: rename otoole-csv paths * fix: make long_name and description optional * tests: skip full otoole construction for now * tests: test region construction * feat: make base osemosys data built from args[0] * fix: rm composable assumptions and targets for now * fix: accidental rename * fix: accident rename test case * tests: commodity construction and compatability * feat: begin refactor to /compat * feat: add 'isnumeric' helper util * refactor: defaults to initial import, don't import pydatnic schemas * refactor: defaults and compat * feat: commodity schema * feat: make data construction more flexible * feat: build and test impact construction * tests: impact otoole roundtrip * fix: some cleanup on commodity testing * tests: touchup test-impact * tests: technology construction * feat: otoole compatability for technology * feat: add to defaults * feat: region and impact compat * feat: validation for technology * tests: runspec construction and roundtrip * feat: add defaults for discount rate depreciation method * feat: instantiate RunSpec on load model * feat: add a depreciation_method enum * feat: include reserve margin in commodity and technology defn * feat: otoole compatability for RunSpec and Technology * fix: return 'self' from model_validator(mode='after') * feat: finish RunSpec model * tests: roundtrip and yaml compatability * fix: merge issues --------- Co-authored-by: edwardxtg <edwardxtg@gmail.com> Co-authored-by: edwardxtg <71764756+edwardxtg@users.noreply.github.com>
Lkruitwagen
added a commit
that referenced
this pull request
Feb 29, 2024
* tests: base oseomosys construction * feat: improvement to base abstraction * feat: add validation for time_defintion * tests: for time_definition * add test_otoole_roundtrip pytest * [SMS-239] cleanup noqa test data (#36) * fix: rm otoole sample data from tests * feat: import utils by name * fix: cleanup some DS store * fix: import utils * Refactor root_validator to model_validator (#37) * tests: otoole_roundtrip * feat: fitler pandas=3. dep warning * tests: roundtrip otoole timedefn * delint * otoole_roundtrip as pytest * fix: rename otoole-csv paths * fix: make long_name and description optional * tests: skip full otoole construction for now * tests: test region construction * feat: make base osemosys data built from args[0] * fix: rm composable assumptions and targets for now * fix: accidental rename * fix: accident rename test case * tests: commodity construction and compatability * feat: begin refactor to /compat * feat: add 'isnumeric' helper util * refactor: defaults to initial import, don't import pydatnic schemas * refactor: defaults and compat * feat: commodity schema * feat: make data construction more flexible * feat: build and test impact construction * tests: impact otoole roundtrip * fix: some cleanup on commodity testing * tests: touchup test-impact * tests: technology construction * feat: otoole compatability for technology * feat: add to defaults * feat: region and impact compat * feat: validation for technology * tests: runspec construction and roundtrip * feat: add defaults for discount rate depreciation method * feat: instantiate RunSpec on load model * feat: add a depreciation_method enum * feat: include reserve margin in commodity and technology defn * feat: otoole compatability for RunSpec and Technology * fix: return 'self' from model_validator(mode='after') * feat: finish RunSpec model * tests: roundtrip and yaml compatability * feat: add data casting for OSeMOSYSData * refactor into composeable OSeMOSYSData class * refactor: move otoole time_defn to compat * feat: test commodity composition * tests: rename composition base test * feat: add dtype to operating mode vars * feat: refactor compose * feat: compose technologies * feat: compose all schema * tests: runspec composition * fix: simplify yaml to start with passing case * feat: load model yaml * fix: create timedefinition from yearparts and dayparts * additional fail cases test_compose_base.py * additional fail cases test_runspec.py * fix: delint --------- Co-authored-by: edwardxtg <edwardxtg@gmail.com> Co-authored-by: edwardxtg <71764756+edwardxtg@users.noreply.github.com>
Lkruitwagen
added a commit
that referenced
this pull request
Feb 29, 2024
* tests: base oseomosys construction * feat: improvement to base abstraction * feat: add validation for time_defintion * tests: for time_definition * add test_otoole_roundtrip pytest * [SMS-239] cleanup noqa test data (#36) * fix: rm otoole sample data from tests * feat: import utils by name * fix: cleanup some DS store * fix: import utils * Refactor root_validator to model_validator (#37) * tests: otoole_roundtrip * feat: fitler pandas=3. dep warning * tests: roundtrip otoole timedefn * delint * otoole_roundtrip as pytest * fix: rename otoole-csv paths * fix: make long_name and description optional * tests: skip full otoole construction for now * tests: test region construction * feat: make base osemosys data built from args[0] * fix: rm composable assumptions and targets for now * fix: accidental rename * fix: accident rename test case * tests: commodity construction and compatability * feat: begin refactor to /compat * feat: add 'isnumeric' helper util * refactor: defaults to initial import, don't import pydatnic schemas * refactor: defaults and compat * feat: commodity schema * feat: make data construction more flexible * feat: build and test impact construction * tests: impact otoole roundtrip * fix: some cleanup on commodity testing * tests: touchup test-impact * tests: technology construction * feat: otoole compatability for technology * feat: add to defaults * feat: region and impact compat * feat: validation for technology * tests: runspec construction and roundtrip * feat: add defaults for discount rate depreciation method * feat: instantiate RunSpec on load model * feat: add a depreciation_method enum * feat: include reserve margin in commodity and technology defn * feat: otoole compatability for RunSpec and Technology * fix: return 'self' from model_validator(mode='after') * feat: finish RunSpec model * tests: roundtrip and yaml compatability * feat: add data casting for OSeMOSYSData * refactor into composeable OSeMOSYSData class * refactor: move otoole time_defn to compat * feat: test commodity composition * tests: rename composition base test * feat: add dtype to operating mode vars * feat: refactor compose * feat: compose technologies * feat: compose all schema * tests: runspec composition * fix: simplify yaml to start with passing case * feat: load model yaml * fix: create timedefinition from yearparts and dayparts * feat: restore direct dict expression * feat: add string casting for dict keys * feat: cast dict keys to str * fix: delint --------- Co-authored-by: edwardxtg <edwardxtg@gmail.com> Co-authored-by: edwardxtg <71764756+edwardxtg@users.noreply.github.com>
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.
Use model_validator instead of root_validator