-
Notifications
You must be signed in to change notification settings - Fork 40
Revision - use typical oemof template #42
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
Conversation
Add h0_dyn as an additional profile next to all other profiles
Add unit tests
11faa9f
to
4f3d7d7
Compare
I am not sure where to locate the examples but everything else looks fine to me. |
I am also not sure if appveyor-tests for Windows are necessary but I implemented some. |
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.
I also don't know where to put the examples. However, we are anyway not consistent within oemof.
tests/test_electricity_demand.py
Outdated
for key in ann_el_demands_per_sector: | ||
assert np.isclose(demands[key], ann_el_demands_per_sector[key]) | ||
matplotlib.use("Agg") | ||
import demandlib_examples.power_demand_example # noqa: F401 |
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.
The import
might incidentally do the correct thing, but exec(open("filename.py").read())
should be the clean way. Alternatively, the example could have a function that can be imported and called from her. (And if __name__ == "__main__"
: in the example script file.)
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.
exec(...) will change the way file is interpreted. Thus, the test script for the examples has to be in the same location the examples are. (Alternatively, only function in the test scrips are tested but not the full scripts.)
Also, all examples in the corresponding directory should be tested just by being in that directory and ending "_example.py".
I fixed the tests after you moved the examples. Everything fine now? |
examples/heat_demand_example.py
Outdated
|
||
# read example temperature series | ||
datapath = os.path.join(os.path.dirname(__file__), "example_data.csv") | ||
datapath = os.path.join(os.getcwd(), "example_data.csv") |
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 will not work if people try to "python ./examples/heat_demand_example.py". But this is probably acceptable.
No description provided.