-
Notifications
You must be signed in to change notification settings - Fork 16
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
copy of MulensData instance #40
Comments
I agree that this is a problem. Currently "bad" and "good" are lists or np.array or something similar. There must be a way to make a class that behaves the way it needs to. For example, a "BadData" class (or maybe the class should be "DataQuality"?) whose properties "bad" and "good" are accessed by MulensData.bad and MulensData.good . Then it would have some kind of indexing method that inherits from list? |
|
I don't see a reason to keep a separate arrays for class MulensData:
@property
def good(self):
return self._good
@property
def bad(self):
return ~self._good
@good.setter
def good(self, value):
self._good = value
@bad.setter
def bad(self, value):
self._good = not value |
We had something like that before. But it turned out that |
Will have to take a look how it was used: shape of array and how often Instead of |
I've checked that the only place where |
The solution I propose won't solve the problem where we want to allow the users to mutate To me, I think it's trivial to get the inverse (i.e., |
MulensData.copy() added in commit 2aff631. Issue not yet fully resolved. |
Added a use case in dd54d4e |
I've checked that the solution from Keto's first reply in this thread is not solving calls like: data.bad[12] = True or data.bad[np.where(data.mag < 13.)] = True Though the same ones for |
That's right, the first solution I proposed will not let you mutate I'm still inclined to suggest not providing your user good = data[~data.bad] |
FYI, giving the user access to only the bad is the same behavior implemented in numpy's masked array. |
I'm writing code for cleaning the data. It involves masking and un-masking points as bad. I've found it quite complicated - one cannot do
because it doesn't change
dataset.good
. One has to do something like:We can either change implementation of
.bad
and.good
(I don't know how - @ketozhang do you know how?) or we can add a function that makes a copy of aMulensData
object. @jenniferyee What do you think?The text was updated successfully, but these errors were encountered: