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

Issue 312 use single config #313

Merged
merged 6 commits into from
Jun 5, 2024
Merged

Issue 312 use single config #313

merged 6 commits into from
Jun 5, 2024

Conversation

finozzifa
Copy link
Contributor

@finozzifa finozzifa commented May 24, 2024

Closes # (if applicable).

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

Changes proposed in this Pull Request

  • add configfile in Snakefile
  • replace c_onfig_pypsa_earth_ with s_nakemake.config_

Checklist

  • I tested my contribution locally and it seems to work fine.
  • Code and workflow changes are sufficiently documented.
  • Newly introduced dependencies are added to envs/environment.yaml and envs/environment.docs.yaml.
  • Changes in configuration options are added in all of config.default.yaml, config.tutorial.yaml, and test/config.test1.yaml.
  • Changes in configuration options are also documented in doc/configtables/*.csv and line references are adjusted in doc/configuration.rst and doc/tutorial.rst.
  • A note for the release notes doc/release_notes.rst is amended in the format of previous release notes, including reference to the requested PR.

@finozzifa finozzifa mentioned this pull request May 24, 2024
18 tasks
@finozzifa
Copy link
Contributor Author

finozzifa commented May 27, 2024

I have exported the value of the objective function at the end of solve_network.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
Copy link
Member

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
Copy link
Contributor Author

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 :)

Copy link
Member

@davide-f davide-f left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As CI passes, I'll be merging this :D
Great @finozzifa :D

@davide-f davide-f merged commit cad684a into pypsa-meets-earth:main Jun 5, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants