Repository navigation
Conversation
A formation name missing from name_id_map (for instance a typo in the orientations file read by create_geomodel) used to surface as a bare KeyError with just the name. The id lookups now raise a ValueError that lists the unknown names and the available ones. Valid input follows the same path as before.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
create_geomodelreads the orientations with thename_id_mapbuilt from the surface points, so a formation name that only appears in the orientations file (a typo, or a translated name as in the report) fails with a bareKeyError: 'Shael'from the id lookup. Nothing says which names were expected or that the two files have to agree.The lookups in
SurfacePointsTable.from_arrays,OrientationsTable.from_arraysandgenerate_ids_from_names(also used byMicroPointsTable) now go through one helper that raises:Valid input takes the same path as before: the comprehension runs inside a
try, and the names are only scanned again after theKeyError, so there is no extra work, memory or state on the normal path.Tests go in
test_community_bugs.py: one runscreate_geomodelon two CSVs that reproduce the report, the other callsfrom_arraysdirectly with a username_id_map. Both fail onmainwith theKeyError.Locally,
test_core,test_api,test_modules,test_model_typesandtest_community_bugsgive 122 passed and 3 skipped: the same 120 that pass onmain, plus the two new tests.Fixes #904
Checklist
or 2. verifies that outputs are as expected for given inputs (e.g. unit tests).