-
Notifications
You must be signed in to change notification settings - Fork 47
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
Immutable searchspace #412
Conversation
94c018c
to
c207e77
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
think this looks pretty nice
unlike in many other places I would rate the depreacation of metadata
very important and it would be nice if it was functional (ie does what the old thing did plus warning) instead of error. Understand this might not be possible, just saying to perhaps catalyze more thought for this
c3ba88c
to
d4794b4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, just some minot comments
b1f89a0
to
a47821e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this important PR. Would appreciate if you could include the test dataframes as an example into the docstring of the toggle
function but I can also live without that, hence already approve.
151b049
to
49e4959
Compare
d278a3f
to
27d1c2d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Happy with everything, would only like to hear your reasons for the singledispatchedmethod.
521b6e8
to
6e1b787
Compare
920123d
to
ce0982a
Compare
Co-authored-by: Martin Fitzner <[email protected]>
Co-authored-by: Martin Fitzner <[email protected]>
ce0982a
to
a0bbc78
Compare
Fixes #371 by making
SubspaceDiscrete
stateless.Current Approach
SubspaceDiscrete.metadata
attribute gets deprecated and the responsibility of metadata handling is shifted toCampaign
pandas
as our search space backend and prepares for future search space improvements by abstracting away the specific implementation details, enabling us to easily offer other backends (polars, databases, etc) in the future.allow_*
flags are not yet migrated to theCampaign
class, but theAnnotatedSubspaceDiscrete
allows to migrate them in a follow-up PR (Moveallow_*
flags toCampaign
#423) without causing much frictionCampaign.toggle_discrete_candidates
now allows convenient and dynamic control over the discrete candidate set, avoiding any fiddling with the backend dataframes and index manipulations. The positive effect can be seen in the much cleaner code parts of the simulation package.Out of scope / (potentially) coming next
allow_*
flags in order to makeCampaign
the unique place where the concept of metadata exists, i.e. campaigns will be the only stateful objects. A PR taking care of this should follow soon because theget_candidates
signature ofSubspaceDiscrete
currently makes not much sense, as it expects these flags in a context where metadata does not exist.AnnotatedSubspaceDiscrete
might become obsolete since theCampaign
class can then theoretically filter down the space before passing it to the recommender. This however requires an efficient implementation that does not cause unnecessary dataframe copies.frozen
. There a few other things that should be addressed at the same time (i.e. general cleanup of the classes).