Closed cudmore closed 3 months ago
Here is the error from the command line. It is occurring in base_mutations diff = original.compare(updated)
.
Traceback (most recent call last):
File "/Users/cudmore/Sites/MapManagerCore/sandbox/addToPoints.py", line 56, in <module>
tryAddSpine()
File "/Users/cudmore/Sites/MapManagerCore/sandbox/addToPoints.py", line 51, in tryAddSpine
map.updateSpine(id, value={
File "/Users/cudmore/Sites/MapManagerCore/mapmanagercore/annotations/base/base_mutation.py", line 83, in updateSpine
return self._update(AnnotationType.Point, spineId, value, replaceLog, skipLog)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/cudmore/Sites/MapManagerCore/mapmanagercore/annotations/base/base_mutation.py", line 116, in _update
diff = original.compare(updated)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/cudmore/opt/miniconda3/envs/mmc-env/lib/python3.11/site-packages/pandas/core/series.py", line 3355, in compare
return super().compare(
^^^^^^^^^^^^^^^^
File "/Users/cudmore/opt/miniconda3/envs/mmc-env/lib/python3.11/site-packages/pandas/core/generic.py", line 10118, in compare
mask = ~((self == other) | (self.isna() & other.isna()))
^^^^^^^^^^^^^
File "/Users/cudmore/opt/miniconda3/envs/mmc-env/lib/python3.11/site-packages/pandas/core/ops/common.py", line 76, in new_method
return method(self, other)
^^^^^^^^^^^^^^^^^^^
File "/Users/cudmore/opt/miniconda3/envs/mmc-env/lib/python3.11/site-packages/pandas/core/arraylike.py", line 40, in __eq__
return self._cmp_method(other, operator.eq)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/cudmore/opt/miniconda3/envs/mmc-env/lib/python3.11/site-packages/pandas/core/series.py", line 6105, in _cmp_method
raise ValueError("Can only compare identically-labeled Series objects")
ValueError: Can only compare identically-labeled Series objects
A-ha, it is because "x" is not a column in the backend dataframe, x is part of a geoPandas Point().
If I modify an actually existing column name it works fine, like
id = "0"
map.updateSpine(id, value={
"xBackgroundOffset": 1,
})
Thanks for the feedback! I refined the api and added type checks so the errors are more legible. The new API also uses typed update dictionaries so interfacing with the API should be easier.
I am trying to run some of the code in the example jupyter notebook to edit spine annotation but it is failing?
This is the code
And this is the error that the code to updateSpine() throws.
Any thoughts?