-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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 duplicate methods #6291
Remove duplicate methods #6291
Conversation
pymc/model.py
Outdated
random_seed : SeedSequenceSeed, default None | ||
Seed(s) for generating initial point from the model. Used in pymc.aesaraf.reseed_rngs |
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.
Not sure if this is the correct indication of this type in the docstring. Kind of long created type. i.e.
Line 1021 in 5d7283e
SeedSequenceSeed = Optional[Union[int, Sequence[int], np.ndarray, np.random.SeedSequence]] |
Also mentioned the function that this value is fed into. Not sure how that renders atm.
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 about right (from here)
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #6291 +/- ##
==========================================
+ Coverage 94.12% 94.14% +0.02%
==========================================
Files 111 111
Lines 23861 23847 -14
==========================================
- Hits 22458 22450 -8
+ Misses 1403 1397 -6
|
@@ -1259,34 +1265,6 @@ def set_data( | |||
|
|||
shared_object.set_value(values) | |||
|
|||
def initial_point(self, seed=None) -> Dict[str, np.ndarray]: |
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.
I think I probably caused this when trying to reorder the methods a bit more logically. There is a shape_from_dims
below the initial point related methods which makes more sense above, close to the other coord/dims related methods.
I would therefore delete the repeated methods above and not these below.
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.
Alright. I will reorder
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.
I put after the dim/coords methods but before set_data. Thought that made enough sense
pymc/model.py
Outdated
@@ -1137,6 +1101,48 @@ def set_dim(self, name: str, new_length: int, coord_values: Optional[Sequence] = | |||
self.dim_lengths[name].set_value(new_length) | |||
return | |||
|
|||
@property | |||
def test_point(self) -> Dict[str, np.ndarray]: |
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.
We can get rid of this deprecated property as well
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.
Done
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 like this is ready to merge, right @ricardoV94 ?
pymc/model.py
Outdated
random_seed : SeedSequenceSeed, default None | ||
Seed(s) for generating initial point from the model. Used in pymc.aesaraf.reseed_rngs |
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 about right (from here)
* remove dups, add type hints, and docstrings * replacing references to old code * reorder and reword * deprecate the "test_point" method * fix NameError. got to work locally
Was it intentional/necessary to change the argument |
it was an intentional change, but next time we should go for a backwards compatible approach with a deprecation warning.. |
Can you be specific with "lots" of breaking changes? Is there something that isn't covered in the tests? Or were your solutions just a grep replace? Replacements in internal code or only personal written sections? |
What is this PR about?
Noticed some duplicated methods in the
pymc/model.py
file mentioned in issue here.Removed the duplication and tried to improve the docstrings
Checklist
Major / Breaking Changes
seed
for initial point no longer supportedBugfixes / New features
Docs / Maintenance
random_seed