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

Improve error checking for node labels #182

Merged
merged 5 commits into from
Oct 31, 2024
Merged

Improve error checking for node labels #182

merged 5 commits into from
Oct 31, 2024

Conversation

jeremykubica
Copy link
Contributor

The node strings must be unique in order to store the data internally in a GraphState. This PR changes the logic to check that each node seen during sampling has a unique string.

Also adds a few very small performance optimizations (e.g. np.array -> np.asarray).

Copy link

Before [18536db] After [8255a16] Ratio Benchmark (Parameter)
1.54±0.1ms 1.36±0.05ms ~0.88 benchmarks.TimeSuite.time_apply_passbands
725±10μs 775±20μs 1.07 benchmarks.TimeSuite.time_fnu_to_flam
4.31±0.3ms 4.43±1ms 1.03 benchmarks.TimeSuite.time_chained_evaluate
121±1μs 124±2μs 1.02 benchmarks.TimeSuite.time_sample_x0_from_distmod
15.7±0.08μs 15.9±0.2μs 1.01 benchmarks.TimeSuite.time_sample_x1_from_hostmass
8.67±0.6ms 8.64±0.1ms 1.00 benchmarks.TimeSuite.time_evaluate_salt3_model
1.36±0.01s 1.35±0.01s 0.99 benchmarks.TimeSuite.time_make_x1_from_hostmass
28.3±0.1μs 27.7±0.4μs 0.98 benchmarks.TimeSuite.time_make_new_salt3_model
9.16±0.1ms 8.91±0.03ms 0.97 benchmarks.TimeSuite.time_load_passbands
4.88±0.1ms 4.69±0.02ms 0.96 benchmarks.TimeSuite.time_evaluate_salt3_passbands

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 3aec1af into main Oct 31, 2024
5 checks passed
@jeremykubica jeremykubica deleted the small_opt branch October 31, 2024 14: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.

2 participants