Skip to content

Add test mode that mocks solving #422

@irr-github

Description

@irr-github

Problem statement

  • testing Pypsa workflows such as pypsa-eur with snakemake is difficult. Pytests doesn't integrate well with it for example. This is because snakemake jobs are subprocesses and tests conditions can't easily be passed to the subprocess
  • in a pure python package, the pypsa network solve step would be mocked (e.g. return q_nom_opt = q_nom)

Request and possible implementation

  • it would be great to have an "is_test" or "mock" flag. In this case the unoptimised network would be returned with mocked opt values (linopy would not run at all)
  • the argument is_test could be passed to linopy as a kwarg in network.optimize if network.optimize already takes kwargs.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions