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 options to output result data #395

Merged
merged 15 commits into from
Dec 1, 2023
Merged

Add options to output result data #395

merged 15 commits into from
Dec 1, 2023

Conversation

jeremykubica
Copy link
Contributor

@jeremykubica jeremykubica commented Nov 30, 2023

Allow users to output options in a two different formats:

  1. serialize the results to YAML for data transfer. This is currently inefficient, because we convert the stamps from numpy arrays to lists for YAML compatibility (numpy arrays need unsafe loading in YAML). We can improve this in the future.
  2. extract the results data to an astropy table for analysis

This PR also moves some of the trajectory serialization into its own file for organizational purposes.

@jeremykubica jeremykubica changed the title Create option to serialize ResultRows and ResultLists to YAML Add options to output result data Nov 30, 2023
Copy link
Collaborator

@wilsonbb wilsonbb left a comment

Choose a reason for hiding this comment

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

LGTM, just a typo and an optional suggestion

tests/test_result_list.py Outdated Show resolved Hide resolved
row = ResultRow(trj, self.num_times)
row.set_psi_phi(np.array([i] * self.num_times), np.array([0.01 * i] * self.num_times))
row.stamp = np.ones((10, 10))
row.all_stamps = np.array([np.ones((10, 10)) for _ in range(self.num_times)])
Copy link
Collaborator

Choose a reason for hiding this comment

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

Optional: np.full can take an ndarray, so might be cleaner to have

row.stamp = np.ones((10, 10))
row.all_stamps = np.full((self.num_times, 10, 10), row.stamp)

@wilsonbb wilsonbb self-requested a review December 1, 2023 00:27
Copy link
Collaborator

@wilsonbb wilsonbb left a comment

Choose a reason for hiding this comment

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

Preemptive approval since the requested change is just a typo

@jeremykubica jeremykubica merged commit 87df589 into main Dec 1, 2023
2 checks passed
@jeremykubica jeremykubica deleted the yaml_results branch December 1, 2023 02:32
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