diff --git a/CHANGELOG.md b/CHANGELOG.md index 4fcab2e..b5182f2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +# dev +- [fix] update pandas to 3.0.0 + # 1.15.9 - [fix] color: fix main diff --git a/environment.yml b/environment.yml index 694e899..91f840e 100644 --- a/environment.yml +++ b/environment.yml @@ -10,7 +10,7 @@ dependencies: - gdal - lastools # for check that lasinfo warnings desapear when standardizing - geopandas - - pandas=2.3.3 # in the next version (3.0.0), test_add_points_from_geometry_to_las fails + - pandas # --------- dev dep --------- # - pre-commit # hooks for applying linters on commit - black # code formatting diff --git a/pdaltools/add_points_in_pointcloud.py b/pdaltools/add_points_in_pointcloud.py index 36a8bad..e206e93 100644 --- a/pdaltools/add_points_in_pointcloud.py +++ b/pdaltools/add_points_in_pointcloud.py @@ -316,9 +316,11 @@ def add_points_from_geometry_to_las( gdf = clip_3d_lines_to_tile(gdf, input_las, spatial_ref, tile_width) # If the geometry type is LineString, generate 3D points if spacing <= 0: + geom_type_str = str(unique_geom_type[0]) # scalar for stable message across pandas versions + print(f"geometry type: {geom_type_str} and spacing = {spacing}") raise NotImplementedError( - f"add_points_from_geometry_to_las requires spacing > 0 to run on (Multi)LineString geometries, \ - but the values provided are geometry type: {unique_geom_type} and spacing = {spacing} " + f"add_points_from_geometry_to_las requires spacing > 0 to run on (Multi)LineString geometries, " + f"but the values provided are geometry type: {geom_type_str} and spacing = {spacing}" ) else: points_gdf = generate_3d_points_from_lines(gdf, spacing, altitude_column) diff --git a/test/test_add_points_in_pointcloud.py b/test/test_add_points_in_pointcloud.py index 6992848..ae19c79 100644 --- a/test/test_add_points_in_pointcloud.py +++ b/test/test_add_points_in_pointcloud.py @@ -317,6 +317,8 @@ def test_add_points_from_geometry_to_las(input_file, input_points, epsg, expecte assert input_las.header.point_format == output_las.header.point_format assert np.array_equal(input_las.header.scales, output_las.header.scales) assert np.array_equal(input_las.header.offsets, output_las.header.offsets) + print(f"input = {input_las.header.vlrs[0].string}") + print(f"output = {output_las.header.vlrs[0].string}") assert input_las.header.vlrs[0].string == output_las.header.vlrs[0].string point_count = compute_count_one_file(OUTPUT_FILE)["68"] diff --git a/test/test_standardize_format.py b/test/test_standardize_format.py index 10fd506..88a49c9 100644 --- a/test/test_standardize_format.py +++ b/test/test_standardize_format.py @@ -9,6 +9,7 @@ import laspy import pdal import pytest +from packaging.version import Version from pdaltools.count_occurences.count_occurences_for_attribute import ( compute_count_one_file, @@ -57,9 +58,10 @@ def test_standardize_format(params): assert os.path.isfile(output_file) # check values from metadata json_info = get_pdal_infos_summary(output_file) - if pdal.info.version < "2.5": + pdal_version = Version(pdal.info.version) + if pdal_version < Version("2.5"): raise NotImplementedError("This test is not implemented for pdal < 2.5") - elif pdal.info.version <= "2.5.2": + elif pdal_version <= Version("2.5.2"): metadata = json_info["summary"]["metadata"][1] else: metadata = json_info["summary"]["metadata"]