pypsa-meets-earth / pypsa-earth-sec

GNU General Public License v3.0
18 stars 16 forks source link

Issue 312 use single config #313

Closed finozzifa closed 3 weeks ago

finozzifa commented 1 month ago

Closes # (if applicable).

The code resolves point Use a single config file from Issue #312.

Changes proposed in this Pull Request

Checklist

finozzifa commented 1 month ago

I have exported the value of the objective function at the end of _solvenetwork.py when I execute

snakemake --cores all run_test

The code snippet is

with open("./data/objective_function.txt", "w") as obj_func_file:
  obj_func_file.write("Objective function: {} \n".format(n.objective))
  obj_func_file.write("Objective constant: {} \n".format(n.objective_constant))

Results obtained from the main branch

Objective function: nan 
Objective constant: 1862023.75

Results obtained from the issue_312_use_single_config branch

Objective function: nan 
Objective constant: 1862023.75
davide-f commented 1 month ago

This looks awesome to me! :D @finozzifa In my opinion we can merge it right away if CI runs.

As a comment, if you use vscode, I recommend to:

  1. setup pre-commit: conda activate pypsa-earth pre-commit install
  2. make sure that pypsa-earth is the default python env: from vscode: view->command pallette->python: select interpreter -> pypsa-earth
finozzifa commented 1 month ago

Hi @davide-f , thanks. It seems to me that all checks have passed and I already follow your recommendations on the environment and pre-commit. Thanks :)