diff --git a/gldcore/geodata/docs/Geodata.ipynb b/gldcore/geodata/docs/Geodata.ipynb index 94e0b7eca..4cc00ff0e 100644 --- a/gldcore/geodata/docs/Geodata.ipynb +++ b/gldcore/geodata/docs/Geodata.ipynb @@ -2026,7 +2026,7 @@ }, { "cell_type": "code", - "execution_count": 62, + "execution_count": 5, "id": "f6cc13cb", "metadata": { "scrolled": false @@ -2036,7 +2036,22 @@ "name": "stdout", "output_type": "stream", "text": [ - "ERROR [geodata/powerline]: 'height'\r\n" + "WARNING [geodata/powerline]: cannot run function CONTACT and 'height' is missing or invalid\n", + " linesag\n", + "position \n", + "0 18.0\n", + "50 12.2\n", + "100 9.4\n", + "150 9.7\n", + "200 13.0\n", + "... ...\n", + "8390 -16.6\n", + "8440 -8.9\n", + "8490 0.6\n", + "8540 12.0\n", + "8583 23.0\n", + "\n", + "[191 rows x 1 columns]\n" ] } ], diff --git a/gldcore/geodata/geodata_powerline.py b/gldcore/geodata/geodata_powerline.py index 1e381b2f7..06b66119a 100644 --- a/gldcore/geodata/geodata_powerline.py +++ b/gldcore/geodata/geodata_powerline.py @@ -567,11 +567,22 @@ def apply(data, options=default_options, config=default_config, warning=print): CONFIG = config result = pandas.DataFrame(data) - result["linesag"] = linesag(data) - result["linesway"] = linesway(data) - result["linegallop"] = linegallop(data) - result["contact"] = contact(result) - + try: + result["linesag"] = linesag(data) + except Exception as err: + WARNING(f"cannot run function LINESAG and {err} is missing or invalid") + try: + result["linesway"] = linesway(data) + except Exception as err: + WARNING(f"cannot run function LINEWAY and {err} is missing or invalid") + try: + result["linegallop"] = linegallop(data) + except Exception as err: + WARNING(f"cannot run function LINEGALLOP and {err} is missing or invalid") + try: + result["contact"] = contact(result) + except Exception as err: + WARNING(f"cannot run function CONTACT and {err} is missing or invalid") return result # perform validation tests