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

Add ability to pull information from Pandas DataFrame or AstroPy Table #183

Merged
merged 1 commit into from
Oct 31, 2024

Conversation

jeremykubica
Copy link
Contributor

Building off the pzflow sampling request (PR #181), add the ability to pre-sample data into an AstroPy table or Pandas DataFrame and then retrieve it during sampling.

This could look like:

from pzflow import Flow

my_flow = Flow(file="something.pkl")
sample_table = flow.sample(1000)

flow_results_node = TableSampler(sample_table)

Copy link

Before [18536db] After [a72a600] Ratio Benchmark (Parameter)
751±800μs 772±500μs 1.03 benchmarks.TimeSuite.time_fnu_to_flam
4.44±0.3ms 4.52±0.5ms 1.02 benchmarks.TimeSuite.time_chained_evaluate
8.79±0.8ms 8.92±1ms 1.02 benchmarks.TimeSuite.time_evaluate_salt3_model
27.1±0.4μs 27.6±0.2μs 1.02 benchmarks.TimeSuite.time_make_new_salt3_model
15.4±0.1μs 15.7±0.2μs 1.02 benchmarks.TimeSuite.time_sample_x1_from_hostmass
4.99±0.3ms 4.97±0.1ms 1 benchmarks.TimeSuite.time_evaluate_salt3_passbands
1.43±0.06ms 1.42±0.1ms 0.99 benchmarks.TimeSuite.time_apply_passbands
8.97±0.04ms 8.89±0.02ms 0.99 benchmarks.TimeSuite.time_load_passbands
1.37±0.02s 1.36±0.01s 0.99 benchmarks.TimeSuite.time_make_x1_from_hostmass
123±2μs 121±3μs 0.98 benchmarks.TimeSuite.time_sample_x0_from_distmod

Click here to view all benchmarks.

Copy link
Member

@OliviaLynn OliviaLynn left a comment

Choose a reason for hiding this comment

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

Looks good!

@jeremykubica jeremykubica merged commit a5b5410 into main Oct 31, 2024
5 checks passed
@jeremykubica jeremykubica deleted the sample_from_df branch October 31, 2024 15:24
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.

2 participants