Skip to content

Conversation

@RobbieKiwi
Copy link
Contributor

Closes #422 .

Changes proposed in this Pull Request

Add an option to use "mock solve", to get a fake result with mock data from the linopy model for testing purposes

Checklist

  • Code changes are sufficiently documented; i.e. new functions contain docstrings and further explanations may be given in doc.
  • Unit tests for new features were added (if applicable).
  • A note for the release notes doc/release_notes.rst of the upcoming release is included.
  • I consent to the release of this PR's code under the MIT license.

Copy link
Collaborator

@FabianHofmann FabianHofmann left a comment

Choose a reason for hiding this comment

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

great, can we add a info logging that mock is running? that would be needed to remind people they should deactivate in the end

# clear cached matrix properties potentially present from previous solve commands
self.matrices.clean_cached_properties()

logger.info(f" Solve problem using {solver_name.title()} solver")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@FabianHofmann There is this line here which will evaluate to " Solve problem using Mock solver" in line with the other solver log statements. Is this sufficient or do you think we need to be more explicit?

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.

Add test mode that mocks solving

2 participants