lincc-frameworks / tdastro

MIT License
4 stars 0 forks source link

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

Closed jeremykubica closed 2 weeks ago

jeremykubica commented 2 weeks ago

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)
github-actions[bot] commented 2 weeks ago
Before [18536db2] After [a72a6008] 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.