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

Remove filters #101

Merged
merged 23 commits into from
Feb 5, 2025
Merged

Remove filters #101

merged 23 commits into from
Feb 5, 2025

Conversation

timmens
Copy link
Member

@timmens timmens commented Feb 3, 2025

In this PR, we remove filters from the code-base.

We remove filters and related code from the code-base without starting a major refactoring. This will be done in a separate PR.

Note

Sparse variables are still required in the simulation; however, no filters are needed and only state variables can be sparse not choices. I will think about a better name for "sparse" variables in this context in the next PRs.

ToDo in next PR's

Refactoring and Renaming

  • Rename sparse and dense variables!
  • Extensive refactoring given the simpler structure
  • Update dispatchers explanation notebook
  • Update return type of _determine_dense_discrete_choice_axes
  • Replace double backticks with single backticks
  • Currently we have discrete_problem._determine_dense_discrete_choice_axes and simulate.determine_discrete_dense_choice_axes: They look similar, and do similar things, but not exactly -> Combine these with an argument like purpose: Literal["solution", "simulation"].

Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@timmens timmens requested a review from hmgaudecker February 4, 2025 09:13
Copy link
Member

@hmgaudecker hmgaudecker left a comment

Choose a reason for hiding this comment

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

Very nice!!!

Most of my comments are probably just me not getting the line between deletion and later refactoring right.

@@ -213,31 +140,19 @@ def _segment_logsumexp(a, segment_info):
def _determine_dense_discrete_choice_axes(
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
def _determine_dense_discrete_choice_axes(
def _determine_discrete_choice_axes(

Not sure whether getting rid of dense terminology is out-of-scope for this PR or not. But might add clarity.

Copy link
Member Author

Choose a reason for hiding this comment

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

I would say it is out-of-scope. The problem is that we still need --what we currently call sparse variables-- for the simulation. I would like to avoid a state of the code-base where we have "variables" and "sparse variables" to avoid confusion. In the upcoming renaming/refactoring PR I am planning to give these two concepts better fitting names.

@hmgaudecker hmgaudecker self-requested a review February 4, 2025 15:00
Copy link
Member

@hmgaudecker hmgaudecker left a comment

Choose a reason for hiding this comment

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

As discussed, looks great with the possible exception of recycling the code from test_state_space !

@timmens timmens merged commit 6d788ad into main Feb 5, 2025
7 checks passed
@timmens timmens deleted the remove-filter branch February 5, 2025 09:25
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