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

More robust from_csv behavior for GridResultContainer #137

Open
t-ober opened this issue Feb 2, 2024 · 0 comments
Open

More robust from_csv behavior for GridResultContainer #137

t-ober opened this issue Feb 2, 2024 · 0 comments

Comments

@t-ober
Copy link
Contributor

t-ober commented Feb 2, 2024

  1. When given a wrong path the GridResultContainer returns "Can't determine simulation end .. " we should hint that this could be due to a wrong path
  2. If the path is wrong but the folder contains a folder called rawOutputData we should use that path

Check if such changes should be implemented for the ResultDicts. l

----> [2](vscode-notebook-cell:?execution_count=7&line=2) res_b = GridResultContainer.from_csv("", os.path.join(res_base_path, name_b))

File [~/coding/python/pypsdm/pypsdm-feature/pypsdm/models/result/container/grid.py:129](https://file+.vscode-resource.vscode-cdn.net/Users/thomas/coding/python/pypsdms/pypsdms/dev/~/coding/python/pypsdm/pypsdm-feature/pypsdm/models/result/container/grid.py:129), in GridResultContainer.from_csv(cls, name, simulation_data_path, delimiter, simulation_end, grid_container, filter_start, filter_end)
    [127](https://file+.vscode-resource.vscode-cdn.net/Users/thomas/coding/python/pypsdms/pypsdms/dev/~/coding/python/pypsdm/pypsdm-feature/pypsdm/models/result/container/grid.py:127) if simulation_end is None:
    [128](https://file+.vscode-resource.vscode-cdn.net/Users/thomas/coding/python/pypsdms/pypsdms/dev/~/coding/python/pypsdm/pypsdm-feature/pypsdm/models/result/container/grid.py:128)     if len(nodes.entities) == 0:
--> [129](https://file+.vscode-resource.vscode-cdn.net/Users/thomas/coding/python/pypsdms/pypsdms/dev/~/coding/python/pypsdm/pypsdm-feature/pypsdm/models/result/container/grid.py:129)         raise ValueError(
    [130](https://file+.vscode-resource.vscode-cdn.net/Users/thomas/coding/python/pypsdms/pypsdms/dev/~/coding/python/pypsdm/pypsdm-feature/pypsdm/models/result/container/grid.py:130)             "Can't determine simulation end time automatically. No node results to base it on. Please configure 'simulation_end' manually."
    [131](https://file+.vscode-resource.vscode-cdn.net/Users/thomas/coding/python/pypsdms/pypsdms/dev/~/coding/python/pypsdm/pypsdm-feature/pypsdm/models/result/container/grid.py:131)         )
    [132](https://file+.vscode-resource.vscode-cdn.net/Users/thomas/coding/python/pypsdms/pypsdms/dev/~/coding/python/pypsdm/pypsdm-feature/pypsdm/models/result/container/grid.py:132)     some_node_res = next(iter(nodes.entities.values()))
    [133](https://file+.vscode-resource.vscode-cdn.net/Users/thomas/coding/python/pypsdms/pypsdms/dev/~/coding/python/pypsdm/pypsdm-feature/pypsdm/models/result/container/grid.py:133)     simulation_end = some_node_res.data.index.max()

ValueError: Can't determine simulation end time automatically. No node results to base it on. Please configure 'simulation_end' manually.
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

No branches or pull requests

1 participant