added the assertion of geom_component._region_data(), since calling that property shows the current bug (fails with IndexError: index 1 is out of bounds for axis 0 with size 1)
solved the IndexError by properly generating total_bounds (was calling over the wrong dimension)
this caused the error box() missing 3 required positional arguments: 'miny', 'maxx', and 'maxy' one line below
solved by adding * to expand the total_bounds argument form a tuple into four separate arguments
this resulted in shapely.errors.GeometryTypeError: Unknown geometry type: 'featurecollection' >> solved by generating the geodataframe like in test_model_set_geoms, but I have no clue if this results in the expected type/format. At least it works, but please check this
made sure the assertion in the test also checked a valid result
General Checklist
[x] Updated tests or added new tests
[x] Branch is up to date with main
[x] Tests & pre-commit hooks pass
[x] Updated documentation >> not relevant
[x] Updated changelog.rst >> add later to avoid conflicts before this PR is merged, it can be something like "fixed geom_component._region_data() (#1091)"
Data/Catalog checklist
[ ] data/catalogs/predefined_catalogs.yml has not been modified.
[ ] None of the old data_catalog.yml files have been chagned
[ ] data/chagnelog.rst has been updated
[ ] new file uses LF line endings (done automatically if you used update_versions.py)
[ ] New file has been tested locally
[ ] Tests have been added using the new file in the test suite
Issue addressed
Fixes #1079
Explanation
My steps:
geom_component._region_data()
, since calling that property shows the current bug (fails withIndexError: index 1 is out of bounds for axis 0 with size 1
)total_bounds
(was calling over the wrong dimension)box() missing 3 required positional arguments: 'miny', 'maxx', and 'maxy'
one line below*
to expand thetotal_bounds
argument form a tuple into four separate argumentsshapely.errors.GeometryTypeError: Unknown geometry type: 'featurecollection'
>> solved by generating the geodataframe like intest_model_set_geoms
, but I have no clue if this results in the expected type/format. At least it works, but please check thisGeneral Checklist
main
geom_component._region_data()
(#1091)"Data/Catalog checklist
data/catalogs/predefined_catalogs.yml
has not been modified.data_catalog.yml
files have been chagneddata/chagnelog.rst
has been updatedLF
line endings (done automatically if you usedupdate_versions.py
)