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

tickets/DM-29728 Introduce configurable actions for DataFrames #523

Merged
merged 1 commit into from Jun 3, 2021

Conversation

natelust
Copy link
Contributor

@natelust natelust commented Jun 1, 2021

This commit introduces a base class for configurable actions that
works on Data Frames, basic concrete actions, and some supporting
functions.

@@ -0,0 +1,3 @@
from ._actions import *
from ._baseDataFrameActions import DataFrameAction
from ._evalColumnExpression import *
Copy link
Contributor

Choose a reason for hiding this comment

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

Are these star imports legit?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, this is pretty normal for a __init__ file, especially if the sub modules are "private"

with np.warnings.catch_warnings():
np.warnings.filterwarnings('ignore', r'invalid value encountered')
np.warnings.filterwarnings('ignore', r'divide by zero')
return -2.5 * np.log10(df[self.column] / fluxMag0)
Copy link
Contributor

Choose a reason for hiding this comment

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

As the plotting code runs on the object tables do you think it is worth making MagColumn by default operate on nanojanskies? The plotting code is currently the main user of these functions but I don't know if it will be forever.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I changed it to MagColumnDN to leave room for something from Janskeys or something

# look up to see if the value is in cache already
if result := self._actionCache.get(key):
print("returning cache")
return result
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this print statement still be here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

nope, good catch

This commit introduces a base class for configurable actions that
works on Data Frames, basic concrete actions, and some supporting
functions.
@natelust natelust merged commit 8d17800 into master Jun 3, 2021
@natelust natelust deleted the tickets/DM-29728 branch June 3, 2021 00:42
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.

None yet

2 participants