generated from rl-institut/rli_template
-
Notifications
You must be signed in to change notification settings - Fork 1
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
Fix and extend tests #48
Merged
Merged
Changes from 49 commits
Commits
Show all changes
50 commits
Select commit
Hold shift + click to select a range
d332e47
Fix Gas generator
FelixMau 4581a23
Add in some more data into mocks
FelixMau a5111a8
Included in `test_data_adapter`
FelixMau 664dec8
Update __init__.py
FelixMau 4d2f0f5
Mapping test adjustments
FelixMau babd2f5
Mapping test adjustments
FelixMau 459fe4b
Pre-commit
FelixMau 32afe2c
Merge remote-tracking branch 'origin/fix-and-extend-tests' into fix-a…
FelixMau 66cee65
pre-commit
FelixMau 2bb4cc6
Pre-comm
FelixMau 68a1377
test_build_datapackage.py
FelixMau 727812f
Adapter is tested in `data_adapter`
FelixMau fbab594
Example is tested when full example is ready
FelixMau 661bf3f
Adding FIXME statements to functionality that is on hold
FelixMau 4d3466f
Fix Gas generator
FelixMau 7e81602
Add in some more data into mocks
FelixMau fb10c1f
Included in `test_data_adapter`
FelixMau 469dc28
Mapping test adjustments
FelixMau f63c251
Mapping test adjustments
FelixMau 5de6b23
Pre-commit
FelixMau a1eb0d2
Update __init__.py
FelixMau eedaac9
pre-commit
FelixMau 76736ec
test_build_datapackage.py
FelixMau f07a1bb
Adapter is tested in `data_adapter`
FelixMau 5c3fceb
Example is tested when full example is ready
FelixMau a0bf5a1
Adding FIXME statements to functionality that is on hold
FelixMau 8b4b1fb
Black&Isort
nailend 0d90d96
Add skip test
nailend 13ae5cd
Adjust collections dir
nailend 7e76ac0
Fix typo
nailend a24aa93
Load test environment variables via conftest.py
henhuy aa05500
Update fixed data adapter
henhuy 6725515
Make linter happy
henhuy 332b7ba
Update data adapter
henhuy 24c1250
Make linter happy
henhuy 7aa38dc
Fix isort
henhuy a7b7303
Fix collections and structures dir defaults
henhuy 5663f45
Update data adapter
henhuy b98db82
Remove support for python v3.8
henhuy a7bac18
Merge remote-tracking branch 'origin/fix-and-extend-tests' into fix-a…
FelixMau 524ab1b
make linter happy
FelixMau a283b57
Check on files in github checks
FelixMau e4e503d
gitkeep filestructure
FelixMau 6bfa77f
further test for utils
FelixMau 4f5c753
Further test on utils
FelixMau e356fd6
fix tests pathing
FelixMau 73951fb
Finally Fixed Pathing
FelixMau 4346896
Linter shall be happy
FelixMau 4ffd485
Add todo
FelixMau 400c000
Improve comments and add ToDo
FelixMau File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
.idea/ | ||
collections/ | ||
collections/* | ||
__pycache__/ | ||
/structures/ | ||
#/structures/ |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import pathlib | ||
|
||
import dotenv | ||
|
||
TEST_ENV_FILE = pathlib.Path(__file__).parent / "tests" / ".env" | ||
dotenv.load_dotenv(TEST_ENV_FILE) |
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# This is a mapping file to map the various processes to the oemof tabular facades. | ||
modex_tech_wind_turbine_onshore: VolatileAdapter | ||
modex_tech_storage_battery: StorageAdapter | ||
modex_tech_generator_gas: ExtractionTurbineAdapter | ||
modex_tech_generator_gas: ConversionAdapter |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,27 @@ | ||
import os | ||
import pathlib | ||
|
||
ROOT_DIR = pathlib.Path(__file__).parent.parent | ||
COLLECTIONS_DIR = ROOT_DIR / "collections" | ||
ROOT_DIR = pathlib.Path(__file__).parent | ||
|
||
COLLECTIONS_DIR = ( | ||
pathlib.Path(os.environ["COLLECTIONS_DIR"]) | ||
if "COLLECTIONS_DIR" in os.environ | ||
else pathlib.Path.cwd() / "collections" | ||
) | ||
if not COLLECTIONS_DIR.exists(): | ||
raise FileNotFoundError( | ||
f"Could not find collections directory '{COLLECTIONS_DIR}'. " | ||
"You should either create the collections folder or " | ||
"change path to collection folder by changing environment variable 'COLLECTIONS_DIR'.", | ||
) | ||
STRUCTURES_DIR = ( | ||
pathlib.Path(os.environ["STRUCTURES_DIR"]) | ||
if "STRUCTURES_DIR" in os.environ | ||
else pathlib.Path.cwd() / "structures" | ||
) | ||
if not STRUCTURES_DIR.exists(): | ||
raise FileNotFoundError( | ||
f"Could not find structure directory '{STRUCTURES_DIR}'. " | ||
"You should either create the structure folder or " | ||
"change path to structure folder by changing environment variable 'STRUCTURES_DIR'.", | ||
) |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
[tool.poetry] | ||
name = "data_adapter_oemof" | ||
name = "data_adapter_oemof_tests" | ||
version = "0.0.1dev" | ||
description = "Data adapter from oedatamodel to oemof.tabular datapackages" | ||
authors = [ | ||
|
@@ -8,16 +8,19 @@ authors = [ | |
"Julian Endres <[email protected]>", | ||
] | ||
|
||
[tool.poetry.group.dev.dependencies] | ||
isort = "^5.12.0" | ||
|
||
[build-system] | ||
requires = ["poetry_core>=1.0.0"] | ||
build-backend = "poetry.core.masonry.api" | ||
|
||
[tool.poetry.dependencies] | ||
python = ">=3.8.1,<3.11" | ||
data_adapter = { git = "https://[email protected]/sedos-project/data_adapter", branch = "dev"} | ||
data_adapter = { git = "https://[email protected]/sedos-project/data_adapter", branch = "main"} | ||
oemof-tabular = { git = "https://[email protected]/oemof/oemof-tabular", tag = "v0.0.4.dev0"} | ||
# fix boto3 to fasten up dependency resolution | ||
boto3 = "1.26.125" | ||
boto3 = "1.26.125" # fix boto3 to fasten up dependency resolution | ||
python-dotenv = "^0.21.0" | ||
|
||
[tool.poetry.dev-dependencies] | ||
black = "20.8b1" | ||
|
@@ -43,3 +46,6 @@ exclude = ''' | |
)/ | ||
''' | ||
max-line-length=100 | ||
|
||
[tool.isort] | ||
profile = "black" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
|
||
COLLECTIONS_DIR=tests/collections | ||
STRUCTURES_DIR=tests/structures |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
name;type;balanced | ||
electricity;bus;True | ||
ch4;bus;True |
4 changes: 4 additions & 0 deletions
4
tests/_files/build_datapackage_goal/data/elements/modex_tech_generator_gas.csv
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
from_bus;to_bus;carrier;tech;capacity;efficiency;marginal_cost;carrier_cost;capacity_cost;expandable;capacity_potential;capacity_minimum;input_parameters;output_parameters;name;type | ||
ch4;electricity;gas;generator_gas;;1;0;0;;False;inf;;{};{};BB-2016-generator_gas;conversion | ||
ch4;electricity;gas;generator_gas;;1;0;0;;False;inf;;{};{};BB-2030-generator_gas;conversion | ||
ch4;electricity;gas;generator_gas;;1;0;0;;False;inf;;{};{};BB-2050-generator_gas;conversion |
4 changes: 4 additions & 0 deletions
4
tests/_files/build_datapackage_goal/data/elements/modex_tech_storage_battery.csv
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
bus;carrier;tech;storage_capacity;capacity;capacity_cost;storage_capacity_cost;storage_capacity_potential;capacity_potential;expandable;lifetime;age;fixed_costs;marginal_cost;efficiency;input_parameters;output_parameters;name;type | ||
electricity;Lithium;storage_battery;0;17.8;0;;inf;inf;False;;0;[];0;1;{};{};BB-2016-storage_battery;storage | ||
electricity;Lithium;storage_battery;0;17.8;0;;inf;inf;False;;0;[];0;1;{};{};BB-2030-storage_battery;storage | ||
electricity;Lithium;storage_battery;0;17.8;0;;inf;inf;False;;0;[];0;1;{};{};BB-2050-storage_battery;storage |
4 changes: 4 additions & 0 deletions
4
tests/_files/build_datapackage_goal/data/elements/modex_tech_wind_turbine_onshore.csv
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
bus;carrier;tech;profile;capacity;capacity_potential;capacity_minimum;expandable;marginal_cost;capacity_cost;lifetime;age;fixed_costs;output_parameters;name;type | ||
electricity;wind;wind_turbine_onshore;onshore_BB;5700.03;inf;;False;0;;25.4;0;23280.0;{};BB-2016-wind_turbine_onshore;volatile | ||
electricity;wind;wind_turbine_onshore;onshore_BB;5700.03375;inf;;False;0;;30.0;0;12600.0;{};BB-2030-wind_turbine_onshore;volatile | ||
electricity;wind;wind_turbine_onshore;onshore_BB;5700.03375;inf;;False;0;;30.0;0;11340.0;{};BB-2050-wind_turbine_onshore;volatile |
10 changes: 10 additions & 0 deletions
10
..._files/build_datapackage_goal/data/sequences/modex_tech_wind_turbine_onshore_sequence.csv
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
timeindex;onshore_BB | ||
2016-01-01T00:00:00;0.0516 | ||
2016-01-01T01:00:00;0.051 | ||
2016-01-01T02:00:00;0.0444 | ||
2030-01-01T00:00:00;0.0526 | ||
2030-01-01T01:00:00;0.051 | ||
2030-01-01T02:00:00;0.0444 | ||
2050-01-01T00:00:00;0.0536 | ||
2050-01-01T01:00:00;0.051 | ||
2050-01-01T02:00:00;0.0444 |
Oops, something went wrong.
Oops, something went wrong.
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.
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.
This comment is a bit confusing, improve or remove?