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

Reading attributes from tables in cell_paths[0] fails if the cell wasn't simulated #1375

Open
ggsun opened this issue Aug 21, 2023 · 1 comment
Labels

Comments

@ggsun
Copy link
Contributor

ggsun commented Aug 21, 2023

Many of our analysis scripts use the first cell in the array cell_paths to read in tables and get table attributes, before using read_stacked_columns to read in entire table columns across multiple cells. If some simulations failed, read_stacked_columns can handle missing tables by setting the ignore_exceptions parameter to True, but if the simulation corresponding to the first cell in the cell_paths array did not run (most likely because a cell from a previous generation failed), reading in a table from cell_paths[0] results in an error. The ordering of the cells in cell_paths seems to be random so it's impossible to predict what seed will be used to read in these attributes.

@ggsun ggsun added the bug label Aug 21, 2023
@rjuenemann
Copy link
Contributor

From my experience, the first entry in cell_paths will be the minimum generation number, with a random seed. For instance, if you aren't filtering by generation when you call cell_paths = ap.get_cells() the first entry should be generation zero from one of the seeds. Even if generation 0 failed partway through the simulation, the tables should still exist.

If you are filtering out generation 0, you might consider doing something like reference_cell = ap.get_cells()[0] without filtering out any generations, then doing cell_paths = ap.get_cells(generation = {whatever} to get the locations of the cells you actually want to extract data from. This way you can use the reference_cell to get the attributes without having to worry about failures.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants