Chilipp / straditize

⛔️ Python package for digitizing pollen diagrams
https://straditize.readthedocs.io
GNU General Public License v3.0
14 stars 5 forks source link

x- and y-axes translations fail silent with invalid numbers #14

Open Chilipp opened 4 years ago

Chilipp commented 4 years ago

Screenshot

[add screenshots of your problem] image

Problem description

When inserting a string that cannot be converted to a floating point number (e.g. 70,01 instead of 70.01), the mark is created and appears on the plot, but it not added to straditize.

Expected Output

Straditize should directly give an error to inform about the invalid number. Instead, this is printed to the terminal:

Terminal output ``` Traceback (most recent call last): File "/Users/psommer/miniconda/envs/work/lib/python3.7/site-packages/matplotlib/cbook/__init__.py", line 215, in process func(*args, **kwargs) File "/Users/psommer/Documents/myplots-scripts/straditize/straditize/straditizer.py", line 123, in ret new_marks = _new_mark(event.xdata, event.ydata) File "/Users/psommer/Documents/myplots-scripts/straditize/straditize/straditizer.py", line 128, in _new_mark new_marks = func((x, y), **kwargs) File "/Users/psommer/Documents/myplots-scripts/straditize/straditize/straditizer.py", line 815, in new_mark ret.ask_for_value(initial, label) File "/Users/psommer/Documents/myplots-scripts/straditize/straditize/cross_mark.py", line 1139, in ask_for_value self.value = self.dtype(value) ValueError: could not convert string to float: '70,01' ```