-
Notifications
You must be signed in to change notification settings - Fork 7k
Write magic methods for SampleBatch/PartialRollout #2002
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
Conversation
Since we typically care about the `.data` attribute, but may not want to just subclass dict (I assume), we can use `dict`'s already implemented magic methods to clean up syntax. These let us just treat rollouts more or less as dicts.
|
Test FAILed. |
|
Test FAILed. |
|
I'd appreciate if someone could take a look at this. The Jenkins build errors out and I'm not really sure why since these changes are either formatting or (I'd think) simple rewrites to use equivalent methods. |
|
Jenkins retest this please. |
|
Thanks @alok, the primary changes look good to me, but can you address the linting errors? Flake8 is failing with and yapf is failing with a bunch of errors. You shouldn't need to change the formatting of any lines beyond the ones you modified in the initial commit I think. |
|
Test PASSed. |
* master: [DataFrame] Add direct pandas imports for MVP (ray-project#1960) Make ActorHandles pickleable, also make proper ActorHandle and ActorC… (ray-project#2007) Expand local_dir in Trial init (ray-project#2013) Fixing ascii error for Python2 (ray-project#2009) [DataFrame] Implements df.update (ray-project#1997) [DataFrame] Implements df.as_matrix (ray-project#2001) [DataFrame] Implement quantile (ray-project#1992) [DataFrame] Impement sort_values and sort_index (ray-project#1977) [DataFrame] Implement rank (ray-project#1991) [DataFrame] Implemented prod, product, added test suite (ray-project#1994) [DataFrame] Implemented __setitem__, select_dtypes, and astype (ray-project#1941) [DataFrame] Implement diff (ray-project#1996) [DataFrame] Implemented nunique, skew (ray-project#1995) [DataFrame] Implements filter and dropna (ray-project#1959) [DataFrame] Implements df.pipe (ray-project#1999) [DataFrame] Apply() for Lists and Dicts (ray-project#1973)
|
Test FAILed. |
|
I decided it might just be easier to put in another PR with no formatting changes. See #2024. |
What do these changes do?
Everybody loves that sweet sweet (syntactic) sugar.
Since we typically care about the
.dataattribute, but may not want to justsubclass dict (I assume), we can use
dict's already implemented magic methodsto clean up syntax. These let us just treat rollouts more or less as dicts.
Related issue number
None.