Skip to content
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

Converting GenX to being a submodule #144

Merged
merged 88 commits into from
Aug 9, 2023
Merged

Converting GenX to being a submodule #144

merged 88 commits into from
Aug 9, 2023

Conversation

RuaridhMacd
Copy link
Collaborator

This is the second attempt at this. The main details of the changes are in PR #139

This PR builds on PR #139 but includes a more recent version of DOLPHYN and updates some of the examples to ensure they work. The following examples work on my linux system:

  • OneZone
  • ThreeZones
  • ThreeZones_liquid (though it runs into numerical issues)
  • 2030_CombEC_DETrans

RuaridhMacd and others added 30 commits January 18, 2023 13:20
Hopefully this'll resolve cloning issues
Lots of small changes to get a MVP.

We're including all the necessary GenX code and then overwritting the relevant pieces with DOLPHYN functions.

I took this include-based approach because if we include("GenX.jl") and/or using GenX we'll create a module which only exports a few of the functions that we need.

We could create a new function which separates the GenX and other pieces, but this keeps all the choices about whether to use GenX or alternative functions in one place
This was just still here to let me compare it to the updated version easily
This should be pushed to GenX if it's useful for all projects
Fixed bugs in write_outputs and TDR for HSC
This allows us to load the DOLPHYN env using "julia --project=." and call "using DOLPHYN" without touching the LOAD_PATH
All GenX files are now included automatically, other than those manually excluded.
We need to remove some unused defaults later
Updated function to recursively find .jl files to not include when including GenX functions. Files can be excluded on a per-file or per-directory basis
@RuaridhMacd
Copy link
Collaborator Author

@Betristor @gn-he @dharik13

Given that I was making some changes, I refreshed the GenX submodule to make sure that all the files were properly included. The examples still work for me, but I'd appreciate if people could test the branch again.

I resolved the documentation issue (I had to update the GitHub workflow to use Julia v1.8). This allows me to push with Gurobi included, and it is still the default solver for the examples.

Several functions were not included in the documentation. I've divided them into two groups. I'd suggest we merge this PR to main asap and then resolve the documentation issues afterwards.

Helper functions which don't need full documentation right now:
│ DOLPHYN.compare_results
│ DOLPHYN.filecmp_byte
│ DOLPHYN.compare_dir
│ DOLPHYN.print_comparison
│ DOLPHYN.select_zones!
│ DOLPHYN.enumerate_zones
│ DOLPHYN.print_and_log
│ DOLPHYN.choose_h2_output_dir

Model functions which need to be added to the documentation:
│ DOLPHYN.h2_storage_investment_energy
│ DOLPHYN.co2_cap_power_hsc
│ DOLPHYN.write_h2_elec_costs
│ DOLPHYN.write_h2_pipeline_level :
│ DOLPHYN.load_h2_demand_liquid
│ DOLPHYN.write_nw_expansion
│ DOLPHYN.write_h2_transmission_flow
│ DOLPHYN.h2_storage_investment_charge

@RuaridhMacd RuaridhMacd requested a review from Betristor June 20, 2023 20:09
@RuaridhMacd
Copy link
Collaborator Author

I've just noticed that the documentation is not pulling the GenX functions properly. See here for an example.

This may be because the functions are now considered part of the GenX module, not DOLPHYN, so we need to rewrite some of the doc/source files.

I'd still recommend that we push this PR so we have a working version of DOLPHYN up, and then we quickly fix all issues with the docs afterwards.

@dharik13
Copy link
Collaborator

Here is what I noticed so far in my tests

What did I test with genx_as_submodule branch

  • SmallNewEngland/OneZone
  • SmallNewEngland/ThreeZone
  • SmallNewEngland/ThreeZone_Liquid
  1. When OverWriteResults=0, models writes results of power system in a new folder (e.g. Results_1) but writes Results of HSC in the previously existing "Results" folder. This is because of how path is defined in GenX Write_Outputs function

  2. There was an error in CO2_cap.csv related to definition of Zone name. For some reason, instead of 1,2,3 values were 1e+10 etc.

  3. ThreeZone_Liquid does not solve and encounters infeasible model. Need to be fixed. I am checking to see if this happens also in the ThreeZone_Liquid example in main.

  4. Is there a way to not pass on redundant files in the GenX repo? For example, "Example_Systems" folder presence within GenX might be confusing for some users.
    5.Can we organize all the additional files needed for HSC into a separate folder instead of just placing them outside as individual files.

1) made edits to CO2_cap.csv files for number of example systems where inputs were not correct
2) Made some changes to ThreeZone_Liquid file to allow for liquefaction only in one zone to see if it resolve infeasible model issue. Model is still infeasible.
@dharik13
Copy link
Collaborator

One more thing - we should probably delete the "SelectZones", "TenZones" examples as well as consider deleting the "2030_CombEC_DETrans" if it is outdated.

@RuaridhMacd
Copy link
Collaborator Author

RuaridhMacd commented Jul 10, 2023

  • @RuaridhMacd Change GenX select_folder function to return the ultimate path used
  • Use that path to point HSC result folder
  • Point the GenX submodule to a reduced branch
  • Move HSC-specific files to the HSC folder
  • Update front-page documentation with method to install submodules and supercloud instructions

@RuaridhMacd RuaridhMacd merged commit 78d16ca into main Aug 9, 2023
@RuaridhMacd RuaridhMacd deleted the genx_as_submodule branch November 2, 2023 17:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DOLPHYN structure How DOLPYHN manages sector coupling and model formulation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants