From 2f203eea9287ec57d20d015fb1041e5002bf0861 Mon Sep 17 00:00:00 2001 From: MelchiorSchuh Date: Mon, 25 Mar 2024 16:07:24 +0100 Subject: [PATCH 1/3] fix(horizons_stack_from_name_list): fix bug on windows. --- .../implicit/representation/core/detail/helpers.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/geode/geosciences/implicit/representation/core/detail/helpers.cpp b/src/geode/geosciences/implicit/representation/core/detail/helpers.cpp index 7b44bdd4..6fb4fa2c 100644 --- a/src/geode/geosciences/implicit/representation/core/detail/helpers.cpp +++ b/src/geode/geosciences/implicit/representation/core/detail/helpers.cpp @@ -57,7 +57,7 @@ namespace void check_number_of_horizons_and_stratigraphic_units( geode::index_t nb_horizons, geode::index_t nb_units ) { - OPENGEODE_EXCEPTION( nb_horizons < nb_units + 2, + OPENGEODE_EXCEPTION( nb_horizons < nb_units + 1, "[repair_horizon_stack_if_possible] Too many horizons compared " "to stratigraphic units (", nb_horizons, ", should be less than ", nb_units, ")" ); @@ -304,8 +304,9 @@ namespace geode for( const auto counter : Range{ 1, horizons_names.size() } ) { const auto& su_above = builder.add_stratigraphic_unit(); - builder.set_stratigraphic_unit_name( su_above, - units_names[counter + lowest_unit_to_create ? -1 : 0] ); + builder.set_stratigraphic_unit_name( + su_above, units_names[lowest_unit_to_create ? counter - 1 + : counter] ); builder.add_horizon_under( stack.horizon( current_horizon ), stack.stratigraphic_unit( su_above ) ); current_horizon = builder.add_horizon(); From 5411a6eac50b9aae2027c236aaa54d9af78cfa6e Mon Sep 17 00:00:00 2001 From: MelchiorSchuh Date: Mon, 25 Mar 2024 15:08:48 +0000 Subject: [PATCH 2/3] Apply prepare changes --- bindings/python/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bindings/python/requirements.txt b/bindings/python/requirements.txt index a992b42b..79d955ec 100644 --- a/bindings/python/requirements.txt +++ b/bindings/python/requirements.txt @@ -2,7 +2,7 @@ # This file is autogenerated by pip-compile with Python 3.10 # by the following command: # -# pip-compile bindings/python/requirements.in +# pip-compile --pre bindings/python/requirements.in # opengeode-core==14.*,>=14.17.0 # via -r bindings/python/requirements.in From 256c6bffca8d60920bd20f01be6fef04e85f1548 Mon Sep 17 00:00:00 2001 From: MelchiorSchuh Date: Mon, 25 Mar 2024 15:08:48 +0000 Subject: [PATCH 3/3] Apply prepare changes --- bindings/python/requirements.txt | 2 +- .../implicit/representation/core/detail/helpers.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bindings/python/requirements.txt b/bindings/python/requirements.txt index a992b42b..79d955ec 100644 --- a/bindings/python/requirements.txt +++ b/bindings/python/requirements.txt @@ -2,7 +2,7 @@ # This file is autogenerated by pip-compile with Python 3.10 # by the following command: # -# pip-compile bindings/python/requirements.in +# pip-compile --pre bindings/python/requirements.in # opengeode-core==14.*,>=14.17.0 # via -r bindings/python/requirements.in diff --git a/src/geode/geosciences/implicit/representation/core/detail/helpers.cpp b/src/geode/geosciences/implicit/representation/core/detail/helpers.cpp index 6fb4fa2c..9dfe9308 100644 --- a/src/geode/geosciences/implicit/representation/core/detail/helpers.cpp +++ b/src/geode/geosciences/implicit/representation/core/detail/helpers.cpp @@ -57,11 +57,11 @@ namespace void check_number_of_horizons_and_stratigraphic_units( geode::index_t nb_horizons, geode::index_t nb_units ) { - OPENGEODE_EXCEPTION( nb_horizons < nb_units + 1, + OPENGEODE_EXCEPTION( nb_horizons <= nb_units + 1, "[repair_horizon_stack_if_possible] Too many horizons compared " "to stratigraphic units (", nb_horizons, ", should be less than ", nb_units, ")" ); - OPENGEODE_EXCEPTION( nb_units < nb_horizons + 2, + OPENGEODE_EXCEPTION( nb_units <= nb_horizons + 1, "[repair_horizon_stack_if_possible] Too many stratigraphic " "units compared to horizons (", nb_units, ", should be less than ", nb_horizons, ")" );