Skip to content

Commit

Permalink
Now even more beautiful code
Browse files Browse the repository at this point in the history
  • Loading branch information
FelixMau committed Nov 14, 2023
1 parent b574457 commit 30dd306
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
1 change: 0 additions & 1 deletion data_adapter_oemof/build_datapackage.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
from typing import Optional

import pandas as pd
import numpy as np
from data_adapter import core
from data_adapter.preprocessing import Adapter
from datapackage import Package
Expand Down
6 changes: 4 additions & 2 deletions data_adapter_oemof/mappings.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,10 @@ def get_data(self, key, field_type: Optional[Type] = None):
f"Using existing timeseries column '{timeseries_key}'."
)
return timeseries_key
logger.info(f"For Process {self.process_name} no timeseries found "
f"entry for mapped key '{key}'")
logger.info(
f"For Process {self.process_name} no timeseries found "
f"entry for mapped key '{key}'"
)
return None

# 2 Use defaults
Expand Down
8 changes: 5 additions & 3 deletions tests/test_build_datapackage.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
import pytest
from data_adapter.databus import download_collection
from data_adapter.preprocessing import Adapter
from oemof.tabular.datapackage import EnergySystem, Model
from oemof.tabular.facades import Bus, Commodity, Dispatchable, Load, Storage, Volatile
from pandas import Timestamp
from utils import PATH_TEST_FILES, check_if_csv_dirs_equal

from data_adapter_oemof.build_datapackage import DataPackage, refactor_timeseries
from oemof.tabular.datapackage import EnergySystem, Model
from oemof.tabular.facades import Dispatchable, Load, Commodity, Storage, Bus, Volatile

path_default = PATH_TEST_FILES / "_files"

Expand Down Expand Up @@ -290,10 +290,12 @@ def test_read_datapackage():
"bus": Bus,
"storage": Storage,
"volatile": Volatile,
"commodity": Commodity
"commodity": Commodity,
},
)
model = Model(es)
test_model = 1
assert model, test_model


def test_period_csv_creation():
Expand Down

0 comments on commit 30dd306

Please sign in to comment.