oemof / DHNx

District heating system optimisation and simulation models
MIT License
27 stars 12 forks source link

Add CI based on tox (github workflows and templates based on oemof.solph) #78

Closed joroeder closed 3 years ago

joroeder commented 3 years ago

This PR suggests tox as test environment, and adds the following github workflows (based on oemof.solph):

Is there anything against using the github actions?

Any changes required? Any comments? - I am not the expert of CI ;-)

joroeder commented 3 years ago

@jnnr It seems that within the test environment, there are problems with the files tests/_files/tree_network_sim_expected_results/calc_pressure_loss.py and tests/_files/tree_network_sim_expected_results/calc_temp_drop.py, that refer to data in the examples folder, that cannot be found (see also test_log_tox). I wonder why there are .py files in `tests/_files/*`` at all? Are these scipts needed? I mean for generating the data files, that are checked within the tests, the scripts for generating the data do not need to be there, right?

Concerning the examples, there are some examples, that generate output files in the respository, that are also not excluded by .gitignore. I commented already two cases (Case1, Case2), as I had problems with the CI, that should be setup with this PR.

Could you have a look at that?

Feel free to directly commit into this PR

joroeder commented 3 years ago

@jnnr It seems that within the test environment, there are problems with the files tests/_files/tree_network_sim_expected_results/calc_pressure_loss.py and tests/_files/tree_network_sim_expected_results/calc_temp_drop.py, that refer to data in the examples folder, that cannot be found (see also test_log_tox). I wonder why there are .py files in `tests/_files/*`` at all? Are these scipts needed? I mean for generating the data files, that are checked within the tests, the scripts for generating the data do not need to be there, right?

There were old parameter names (diameter_mm, length_m), I fixed them, and the scripts are running. I am still wondering why there are the files? Maybe, we should at least remove the link to data in the examples (e.g. if the examples are moved in future, the tests raise errors.) - separate issue/PR?

Concerning the examples, there are some examples, that generate output files in the respository, that are also not excluded by .gitignore. I commented already two cases (Case1, Case2), as I had problems with the CI, that should be setup with this PR.

We could do this also in a separate PR, as there are no conflicts with the CI at the moment.

joroeder commented 3 years ago

From my side, this PR is done. (besides resolving the remaining comments and questions)

joroeder commented 3 years ago

Hey @jnnr

I completed the open things we discussed:

As everything looks fine now, I will merge this PR.