Add GitHub Action for testing of Networks
Feature Request
Similar to PyPSA-Eur implementation here, adding in a GitHub action to test network configurations would be good.
Suggested Solution
No response
Additional Info
No response
9777d41d260933686baf58d11e56e377063f7e90 created main.yml file for github CI actions. Pulled directly from PyPSA-EUR with modification for our repo.....
Workflow fails- I disabled the action workflow until we spend time to fix the issues
#208 fixed the issue with the action not running.... Now I'm looking at the way we call the .test.sh script.... currently when you want to run a specific config.****.yaml you need to change the snakemake file to uncomment out the config you want to use...
We need to change this so the config is called directly from the snakemake run command.
While this does not test the networks, the Calliope team showcase a nice way of validating all configuration files against standardized schemas, here
Chatting with @ktehranchi, a potential way of testing workflow functionality is to:
- For each test config, supply the existing intermediate network files
- Generate new network files for the proposed changes (not sure how we go about this)
- Test dataframes against one another
import pypsa
from pandas.testing import assert_frame_equal
n_fixture = pypsa.Network(fixture.nc)
n_new = pypsa.Network(new.nc)
assert_frame_equal(n_fixture.loads_t["p_set"], n_new.loads_t["p_set"]
Is this still opened? I think I can work on this.
@shankarkarki - it is still open! It does feels like a few things have been discussed in this thread, that may be worth breaking out:
- The testing for valid configuration files (see also issue #382)
- The testing of modules and functions
- The testing of the entire workflow (ie. given specific config files, a workflow should run)
May be worth breaking this out into separate issues to facilitate discussion on each topic. Replicating the PyPSA-Eur testing of the workflow (ie. item 3) for PyPSA-USA would probably be doable! But maybe @ktehranchi has other thoughts.
@shankarkarki let me know if you would like to chat about this issue! I agree with trevor on breaking out this ticket. A good place to start would be to reference the testing set up in pypsa-eur for inspiration
On the testing of the entire workflow front, this repository may be a good reference. They give examples on how to call different config files for their CI, and how to set up simple data + config files for their tests.