Skip to content

Naut combined#408

Open
sblunt wants to merge 42 commits into
sblunt:mainfrom
eshelDror:naut_combined
Open

Naut combined#408
sblunt wants to merge 42 commits into
sblunt:mainfrom
eshelDror:naut_combined

Conversation

@sblunt

@sblunt sblunt commented Jun 9, 2026

Copy link
Copy Markdown
Owner

No description provided.

eshelDror and others added 30 commits April 6, 2026 10:34
Comment thread orbitize/plot.py


def plot_corner(results, param_list=None, **corner_kwargs):
def plot_corner(results, param_list=None, downsample=None, **corner_kwargs):

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Nice keyword addition! Can you a unit test that tests whether the corner plot runs with the downsample keyword set? I assume the current unit tests will test the case where the keyword isn't set, but I haven't actually looked-- please check that too.

Comment thread orbitize/plot.py
else:
fixed_indices.append(i)

if downsample:

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

if downsample is not None

Comment thread orbitize/plot.py
corner_kwargs["labels"] = reduced_labels_list

figure = corner.corner(samples, **corner_kwargs)
figure = corner.corner(samples, **corner_kwargs, weights=weights)

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

minor style thing but the weights=weights should go before **corner_kwargs

Comment thread tests/test_nautilus.py
test_nautilus_general()


# TO DO

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

remove these comments or convert to individual # TODO comment lines

my_sampler = sampler.NautilusSampler(my_system)

print(f"Running {datafile} sampler {I} with {n_threads} {n_live} {n_update} {sampler_args} {run_args}")
# Run the sampler to compute some orbits, yeah!

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

yeah!!!

@@ -0,0 +1,78 @@
import os
os.environ['OPENBLAS_NUM_THREADS'] = '1'

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

it's good to remove os-specific configurations like this in unit tests that will run in a variety of environments (e.g. with a different linear algebra library)

sampler_args = {"n_networks": 4}
run_args = {"f_live": 0.01, "n_eff": 10000}

I = 1

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

What is this variable needed for?


my_sampler.results.save_results(results_file)

# make corner plot

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

I think you can comment this line back in. It's ok to make plots in end-to-end tests.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

I'd probably recommend removing the OFTI end-to-end test and one of the two nautilus end-to-end tests from the main code branch here. You should certainly maintain these in a different repository along with any code you wrote to analyze the outputs of the code, but we probably only need one e2e test of this kind in the main repository.

Comment thread orbitize/results.py
data (astropy.table.Table): output from ``orbitize.read_input.read_file()``
curr_pos (np.array of float): for MCMC only. A multi-D array of the
current walker positions that is used for restarting a MCMC sampler.
weighted_post (np.array of float): RxN array of orbital parameters

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Nice! Please add a unit test for saving and loading results objects created by nautilus.

Comment thread orbitize/sampler.py
orbits we need model predictions for. It returns ``clnlikes``
which is an array of length M, or it can be a single float if M = 1.

Thea McKenna, Sarah Blunt, & Lea Hirsch 2024

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Make sure to update the docstrings to a) give yourselves appropriate credit for code you wrote, and b) make sure you're referring to nautilus and not dynesty

Comment thread orbitize/sampler.py
self.start = time.time()

def nautilus_ptform(self, u):
return self.ptform(u.T).T

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

nice catch on the differing dimension conventions here.

Comment thread orbitize/sampler.py
Class distribution.
"""
utform = np.zeros(u.shape)
for i in range(u.shape[0]):

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Did your vectorized version not make it in here?

@sblunt sblunt mentioned this pull request Jun 15, 2026
@sblunt sblunt marked this pull request as ready for review June 15, 2026 15:50
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