diff --git a/.coverage b/.coverage index 8f84519813e6b48a536cf38897631b201ff12d6a..47a477cf00d63cb7e1615531a64bdf3fc2aa611b 100644 Binary files a/.coverage and b/.coverage differ diff --git a/server/data_processing/__pycache__/add_new_lidar_measurement.cpython-39.pyc b/server/data_processing/__pycache__/add_new_lidar_measurement.cpython-39.pyc index ee8da4fc4cea654ec78f148b78faa6642a218b9d..4406a32cd7b1f569eb54226948bbc88b6cdea72b 100644 Binary files a/server/data_processing/__pycache__/add_new_lidar_measurement.cpython-39.pyc and b/server/data_processing/__pycache__/add_new_lidar_measurement.cpython-39.pyc differ diff --git a/server/data_processing/__pycache__/input_new_data.cpython-39.pyc b/server/data_processing/__pycache__/input_new_data.cpython-39.pyc index 1ba1de3faa52b6a385fb82c82e491b30b6c15a10..45cb41f8acc614ec476f2bcc83b3726cecb30b75 100644 Binary files a/server/data_processing/__pycache__/input_new_data.cpython-39.pyc and b/server/data_processing/__pycache__/input_new_data.cpython-39.pyc differ diff --git a/server/data_processing/__pycache__/process_lidar_data.cpython-39.pyc b/server/data_processing/__pycache__/process_lidar_data.cpython-39.pyc index 00c429468ce27e0ca4e0f6b21e30495022da114e..8a3f4d8f6f5e8239dddfaff06199251db6a4d627 100644 Binary files a/server/data_processing/__pycache__/process_lidar_data.cpython-39.pyc and b/server/data_processing/__pycache__/process_lidar_data.cpython-39.pyc differ diff --git a/server/data_processing/add_new_lidar_measurement.py b/server/data_processing/add_new_lidar_measurement.py index 09c0f290318565a80360d07db45a5bc02a63e723..b164087618ad6edcb7b0d711efbc57e90c3206ff 100644 --- a/server/data_processing/add_new_lidar_measurement.py +++ b/server/data_processing/add_new_lidar_measurement.py @@ -37,13 +37,14 @@ def add_new_lidar_measurement(lake_name: str, lat: float, lon: float): # time last updated data time_now = datetime.now().utcnow().replace(microsecond=0) + measurement_data = [] content = [] # check if water body data exist, else create if os.path.exists(file_path): # get the areas from the map's data with open(file_path) as data: - measurement_data = json.load(data) + measurement_data.append(json.load(data)) # create an empty container for new measurement new_measurement_data = { diff --git a/server/data_processing/unit_tests/__pycache__/test_add_new_lidar_measurement.cpython-39-pytest-7.1.2.pyc b/server/data_processing/unit_tests/__pycache__/test_add_new_lidar_measurement.cpython-39-pytest-7.1.2.pyc index 7e6274e8a928f4ee2ffbd468e95f95fc35e78608..7f8ee66a5dae6e936bc6eaf16b9a98eedcfc3970 100644 Binary files a/server/data_processing/unit_tests/__pycache__/test_add_new_lidar_measurement.cpython-39-pytest-7.1.2.pyc and b/server/data_processing/unit_tests/__pycache__/test_add_new_lidar_measurement.cpython-39-pytest-7.1.2.pyc differ diff --git a/server/data_processing/unit_tests/__pycache__/test_area__processing.cpython-39-pytest-7.1.2.pyc b/server/data_processing/unit_tests/__pycache__/test_area__processing.cpython-39-pytest-7.1.2.pyc index 8b0f8126b378c7b1fe671e6a619184c6665dd649..47168a75cd5c324ecdec32272eed0aab6335d55b 100644 Binary files a/server/data_processing/unit_tests/__pycache__/test_area__processing.cpython-39-pytest-7.1.2.pyc and b/server/data_processing/unit_tests/__pycache__/test_area__processing.cpython-39-pytest-7.1.2.pyc differ diff --git a/server/data_processing/unit_tests/__pycache__/test_input_new_data.cpython-39-pytest-7.1.2.pyc b/server/data_processing/unit_tests/__pycache__/test_input_new_data.cpython-39-pytest-7.1.2.pyc index 5a59c60c9e3d39232d707bdb849cda1b0662ee6b..362b6638403bfece0e1fd44a1e1cf8ca04f65097 100644 Binary files a/server/data_processing/unit_tests/__pycache__/test_input_new_data.cpython-39-pytest-7.1.2.pyc and b/server/data_processing/unit_tests/__pycache__/test_input_new_data.cpython-39-pytest-7.1.2.pyc differ diff --git a/server/data_processing/unit_tests/__pycache__/test_process_lidar_data.cpython-39-pytest-7.1.2.pyc b/server/data_processing/unit_tests/__pycache__/test_process_lidar_data.cpython-39-pytest-7.1.2.pyc index 5dfcb06993571753922d7c912bb5320171e58fd1..1aeecffb47588b446700acb5909548e61864fe18 100644 Binary files a/server/data_processing/unit_tests/__pycache__/test_process_lidar_data.cpython-39-pytest-7.1.2.pyc and b/server/data_processing/unit_tests/__pycache__/test_process_lidar_data.cpython-39-pytest-7.1.2.pyc differ diff --git a/server/data_processing/unit_tests/test_add_new_lidar_measurement.py b/server/data_processing/unit_tests/test_add_new_lidar_measurement.py index c4c7e7f1445c4920b79762a7e26d5df69832b52c..77e75bc1547f70b43c08bbe86097def26f20ac4e 100644 --- a/server/data_processing/unit_tests/test_add_new_lidar_measurement.py +++ b/server/data_processing/unit_tests/test_add_new_lidar_measurement.py @@ -31,8 +31,8 @@ def test_add_new_lidar_measurement_valid_lake() -> None: expected = 200 print("sub", u) # remove temporary files and directories - #if os.path.exists(file_path): - # os.remove(file_path) + if os.path.exists(file_path): + os.remove(file_path) if os.path.isdir(dir_path): os.rmdir(dir_path) diff --git a/server/map_handler/lake_relations/fake_for_test_lidar_data.json b/server/map_handler/lake_relations/fake_for_test_lidar_data.json deleted file mode 100644 index 3c6b0e03586ba68b2b1159787fbe7f8b323d9e5d..0000000000000000000000000000000000000000 --- a/server/map_handler/lake_relations/fake_for_test_lidar_data.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "MeasurementID": 0, - "TimeMeasured": "2024-05-17 17:57:33", - "CenterLat": 0.0, - "CenterLon": 0.0, - "Sensor": { - "SensorId": 2, - "SensorType": "LiDar", - "Active": true - }, - "Subdivisions": [] -} \ No newline at end of file diff --git a/server/map_handler/unit_tests/__pycache__/test_add_new_lake.cpython-39-pytest-7.1.2.pyc b/server/map_handler/unit_tests/__pycache__/test_add_new_lake.cpython-39-pytest-7.1.2.pyc index 261eb2acd5a6466fc4de2661d85459b9a60cfc3e..557448369ab68b884548149fd118e7d68b5323c4 100644 Binary files a/server/map_handler/unit_tests/__pycache__/test_add_new_lake.cpython-39-pytest-7.1.2.pyc and b/server/map_handler/unit_tests/__pycache__/test_add_new_lake.cpython-39-pytest-7.1.2.pyc differ diff --git a/server/map_handler/unit_tests/__pycache__/test_get_lake_relation.cpython-39-pytest-7.1.2.pyc b/server/map_handler/unit_tests/__pycache__/test_get_lake_relation.cpython-39-pytest-7.1.2.pyc index 5d5eae0f8e8d45ee897e410a54847f58928f40cb..35f4489ea4c01df45635b85a80db6dbad88ec8ee 100644 Binary files a/server/map_handler/unit_tests/__pycache__/test_get_lake_relation.cpython-39-pytest-7.1.2.pyc and b/server/map_handler/unit_tests/__pycache__/test_get_lake_relation.cpython-39-pytest-7.1.2.pyc differ diff --git a/server/map_handler/unit_tests/__pycache__/test_update_measurements.cpython-39-pytest-7.1.2.pyc b/server/map_handler/unit_tests/__pycache__/test_update_measurements.cpython-39-pytest-7.1.2.pyc index 6294989bf550296395b1796092702b628bafe59b..944a1b16bc51d18f26e31f44d1120f3dc0adad15 100644 Binary files a/server/map_handler/unit_tests/__pycache__/test_update_measurements.cpython-39-pytest-7.1.2.pyc and b/server/map_handler/unit_tests/__pycache__/test_update_measurements.cpython-39-pytest-7.1.2.pyc differ diff --git a/server/map_handler/unit_tests/test_add_new_lake.py b/server/map_handler/unit_tests/test_add_new_lake.py index 468b3cb3bbca81a204576b578439a57f6fe25d86..bdd4a099db1d57e4becff38a52eeb3ea1ffbb74f 100644 --- a/server/map_handler/unit_tests/test_add_new_lake.py +++ b/server/map_handler/unit_tests/test_add_new_lake.py @@ -1,4 +1,4 @@ -'''import os +import os import json from shapely.geometry import Polygon, LineString @@ -51,6 +51,3 @@ def test_write_json_to_file() -> None: # Remove the test file os.remove(test_path) - - -''' \ No newline at end of file diff --git a/server/map_handler/unit_tests/test_get_lake_relation.py b/server/map_handler/unit_tests/test_get_lake_relation.py index d129ab698f0f0d69d8e266a9e6e6f6e50240529c..26ba06b5db5730415a5d7ac220c1af35ec066362 100644 --- a/server/map_handler/unit_tests/test_get_lake_relation.py +++ b/server/map_handler/unit_tests/test_get_lake_relation.py @@ -1,4 +1,4 @@ -'''from server.map_handler.get_lake_relation import fetch_data +from server.map_handler.get_lake_relation import fetch_data def test_fetch_data_true() -> None: @@ -23,4 +23,3 @@ def test_fetch_data_no_lake() -> None: status_code, _ = fetch_data(test_lake_name, False) assert status_code == 404 -''' \ No newline at end of file diff --git a/server/map_handler/unit_tests/test_update_measurements.py b/server/map_handler/unit_tests/test_update_measurements.py index d3bf4811f9edbb75cad3864774f1c9e29b27bcc2..e8942cefeb9bbbd3093610679bf55fecf04ed0d9 100644 --- a/server/map_handler/unit_tests/test_update_measurements.py +++ b/server/map_handler/unit_tests/test_update_measurements.py @@ -1,4 +1,4 @@ -'''from server.map_handler.update_measurements import update_measurements +from server.map_handler.update_measurements import update_measurements def test_update_measurements_invalid_lake() -> None: test_lake_name = "test_lake" @@ -13,4 +13,3 @@ def test_update_measurements_valid_lake() -> None: status_code, _ = update_measurements(test_lake_name) assert status_code == 200 -''' \ No newline at end of file