techmatters / soil-id-algorithm

GNU Affero General Public License v3.0
1 stars 0 forks source link

bug: algorithm crash "InvalidIndexError" #186

Open shrouxm opened 1 month ago

shrouxm commented 1 month ago

Site info

coordinates: -119.2501602, 39.9782257 pedon key in test CSV file: 7056

traceback

Traceback (most recent call last):
  File "/home/roux/terraso/soil-id-algorithm/soil_id/tests/us/test_us.py", line 118, in test_with_real_data
    result_record["rank_result"] = rank_soils(
                                   ^^^^^^^^^^^
  File "/home/roux/terraso/soil-id-algorithm/soil_id/us_soil.py", line 1793, in rank_soils
    sliceT = pd.concat(slice_data, axis=1).T
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/roux/terraso/soil-id-algorithm/.venv/lib/python3.12/site-packages/pandas/core/reshape/concat.py", line 395, in concat
    return op.get_result()
           ^^^^^^^^^^^^^^^
  File "/home/roux/terraso/soil-id-algorithm/.venv/lib/python3.12/site-packages/pandas/core/reshape/concat.py", line 680, in get_result
    indexers[ax] = obj_labels.get_indexer(new_labels)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/roux/terraso/soil-id-algorithm/.venv/lib/python3.12/site-packages/pandas/core/indexes/base.py", line 3885, in get_indexer
    raise InvalidIndexError(self._requires_unique_msg)
pandas.errors.InvalidIndexError: Reindexing only valid with uniquely valued Index objects