Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
2a1c3cc
Wip
balazsdukai Aug 14, 2025
e50dd64
Update to test_data_14-wip
balazsdukai Aug 14, 2025
170a604
tile name
GinaStavropoulou Aug 14, 2025
fc07873
Merge branch '235-update-test-data' of github.com:3DBAG/3dbag-pipelin…
GinaStavropoulou Aug 14, 2025
0cd5683
This works for me with test_data_v14-wip
balazsdukai Aug 14, 2025
32df188
clean init
GinaStavropoulou Aug 14, 2025
f34d888
fix core integration
GinaStavropoulou Aug 14, 2025
03d198d
formatting
GinaStavropoulou Aug 14, 2025
f92bc1c
fixed party_walls integration test
GinaStavropoulou Aug 14, 2025
19cfc63
removed unecessary data removal
GinaStavropoulou Aug 14, 2025
a442f94
removed query print
GinaStavropoulou Aug 14, 2025
77a7299
clean up init
GinaStavropoulou Aug 14, 2025
26b0d85
sample laz file
GinaStavropoulou Aug 14, 2025
c174c03
fixed floors-estimation integration -test
GinaStavropoulou Aug 14, 2025
00dbfa8
fixes for floors
GinaStavropoulou Aug 14, 2025
1977555
fix for party walls
GinaStavropoulou Aug 14, 2025
7f5dd46
party walls unit tests
GinaStavropoulou Aug 15, 2025
24bbdf9
floors-estimation unit test
GinaStavropoulou Aug 15, 2025
87f2cf4
formatting
GinaStavropoulou Aug 15, 2025
cdcaee3
make file update with new data
GinaStavropoulou Aug 15, 2025
66ae39f
not elegant but this is for now
GinaStavropoulou Aug 15, 2025
b9b1e55
typo in makefile
GinaStavropoulou Aug 15, 2025
74e760c
Enable all tests
balazsdukai Aug 15, 2025
a7299b4
add back logging
GinaStavropoulou Aug 15, 2025
305b59d
Merge branch 'fix/235--update-test-data' of github.com:3DBAG/3dbag-pi…
GinaStavropoulou Aug 15, 2025
f5d3586
test data version
GinaStavropoulou Aug 15, 2025
4d84463
small doc fix
GinaStavropoulou Aug 19, 2025
75e0097
removed pkl file for mock_distribution_tiles_files_index
GinaStavropoulou Aug 19, 2025
65b33ae
removed features_file_index pkl
GinaStavropoulou Aug 19, 2025
86dce57
more party wall test fixes
GinaStavropoulou Aug 19, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion makefile
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ include .env
download:
rm -rf $(BAG3D_TEST_DATA)
mkdir -p $(BAG3D_TEST_DATA)
cd $(BAG3D_TEST_DATA) ; curl -O https://data.3dbag.nl/testdata/pipeline/test_data_v13.zip ; unzip -q test_data_v13.zip ; rm test_data_v13.zip
cd $(BAG3D_TEST_DATA) ; curl -O https://data.3dbag.nl/testdata/pipeline/test_data_v14.zip ; unzip -q test_data_v14.zip ; rm test_data_v14.zip


install_uv:
Expand Down
29 changes: 0 additions & 29 deletions packages/common/src/bag3d/common/resources/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import os
from pathlib import Path

from bag3d.common.resources.executables import (
GDALResource,
Expand Down Expand Up @@ -60,17 +59,6 @@
file_store = FileStoreResource(data_dir=os.getenv("BAG3D_FILESTORE"))
file_store_fastssd = FileStoreResource(data_dir=os.getenv("BAG3D_FILESTORE_FASTSSD"))

file_store_test = FileStoreResource(
data_dir=str(Path(os.getenv("BAG3D_FILESTORE")) / "reconstruction_input")
)
file_store_fastssd_test = FileStoreResource(
data_dir=str(Path(os.getenv("BAG3D_FILESTORE")) / "integration_core")
)

# Configure for gilfoyle
file_store_gilfoyle = FileStoreResource(data_dir="/data")
file_store_gilfoyle_fastssd = FileStoreResource(data_dir="/fastssd/data")


lastools = LASToolsResource(
exe_lasindex=os.getenv("EXE_PATH_LASINDEX"),
Expand Down Expand Up @@ -118,23 +106,6 @@
}


# RESOURCES_TEST = {
# "gdal": gdal,
# "file_store": file_store_test,
# "file_store_fastssd": file_store_fastssd_test,
# "db_connection": db_connection,
# "pdal": pdal,
# "lastools": lastools,
# "tyler": tyler,
# "geoflow": geoflow,
# "validation": validation,
# "roofer": roofer,
# "version": version,
# "specs": specs,
# "godzilla_server": godzilla_server,
# "podzilla_server": podzilla_server,
# }
#
# RESOURCES_PROD = {
# "gdal": gdal,
# "file_store": file_store_gilfoyle,
Expand Down
4 changes: 3 additions & 1 deletion packages/common/src/bag3d/common/utils/files.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,9 @@ def get_export_tile_ids() -> Sequence[str]:

env = os.getenv("DAGSTER_ENVIRONMENT", "test")
if env == "test":
root_dir = Path(os.getenv("BAG3D_FILESTORE")) / "reconstruction_input"
root_dir = (
Path(os.getenv("BAG3D_FILESTORE")) / "integration_party_walls/file_store"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did you change this? Why set to "integration_party_walls/file_store"?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is not nested, for each integration test I have a filestore and a filestore_fastssd, so that it is clear (like we havei n production)

)
version = "test_version"
else:
root_dir = Path(os.getenv("BAG3D_FILESTORE", "/data"))
Expand Down
7 changes: 5 additions & 2 deletions packages/common/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,5 +109,8 @@ def test_data_dir():


@pytest.fixture(scope="session")
def laz_files_ahn3_dir(test_data_dir):
yield test_data_dir / "reconstruction_input/pointcloud/AHN3/as_downloaded/LAZ"
def sample_laz_file(test_data_dir):
yield (
test_data_dir
/ "integration_core/file_store/pointcloud/AHN3/as_downloaded/LAZ/C_32BZ2.LAZ"
)
11 changes: 4 additions & 7 deletions packages/common/tests/test_resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,15 @@ def test_gdal_local(test_data_dir):
assert return_code == 0


def test_pdal_local(laz_files_ahn3_dir):
def test_pdal_local(sample_laz_file):
"""Use local PDAL installation"""
pdal = PDALResource(exe_pdal=EnvVar("EXE_PATH_PDAL").get_value())
assert not pdal.with_docker
filepath = laz_files_ahn3_dir / "C_32BZ2.LAZ"
return_code, output = pdal_info(pdal.app, filepath, with_all=True)
return_code, output = pdal_info(pdal.app, sample_laz_file, with_all=True)
assert return_code == 0


def test_lastools(laz_files_ahn3_dir):
def test_lastools(sample_laz_file):
lastools_resource = LASToolsResource(
exe_lasindex=EnvVar("EXE_PATH_LASINDEX").get_value(),
exe_las2las=EnvVar("EXE_PATH_LAS2LAS").get_value(),
Expand All @@ -55,8 +54,6 @@ def test_lastools(laz_files_ahn3_dir):

lastools = lastools_resource.app

filepath = laz_files_ahn3_dir / "C_32BZ2.LAZ"

cmd_list = [
"{exe}",
"-i {local_path}",
Expand All @@ -66,7 +63,7 @@ def test_lastools(laz_files_ahn3_dir):
"-dont_reindex",
]
return_code, output = lastools.execute(
"lasindex", " ".join(cmd_list), local_path=filepath
"lasindex", " ".join(cmd_list), local_path=sample_laz_file
)

assert return_code == 0
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/bag3d/core/assets/ahn/metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ def compute_load_metadata(
ST_SetSRID(ST_GeomFromGeoJSON({boundary}), 28992)
);
""").format(**query_params)
context.log.info(conn.print_query(query))
context.log.debug(conn.print_query(query))
conn.send_query(query)
# Cannot index the table here, because this is a partitioned assed. This means that
# this function is called for each partition, which would index the table after
Expand Down
41 changes: 41 additions & 0 deletions packages/core/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,30 @@ def context(
)


@pytest.fixture
def context_ahn(
database,
file_store,
gdal,
validation,
godzilla_server,
podzilla_server,
):
yield build_op_context(
partition_key="01cz1",
resources={
"gdal": gdal,
"validation": validation,
"db_connection": database,
"file_store": file_store,
"version": VersionResource("test_version"),
"godzilla_server": godzilla_server,
"podzilla_server": podzilla_server,
"specs": Specs3DBAGResource(),
},
)


@pytest.fixture
def context_missing(
database, wkt_testarea, file_store, gdal_missing, validation_missing
Expand Down Expand Up @@ -265,6 +289,23 @@ def test_data_dir():
yield Path(LOCAL_DIR)


@pytest.fixture(scope="session")
def core_integration_test_dir(test_data_dir):
yield test_data_dir / "integration_core"


@pytest.fixture(scope="session")
def core_file_store_fastssd(core_integration_test_dir) -> Path:
"""Root directory path for test data"""
return core_integration_test_dir / "file_store_fastssd"


@pytest.fixture(scope="session")
def core_file_store(core_integration_test_dir) -> Path:
"""Root directory path for test data"""
return core_integration_test_dir / "file_store"


@pytest.fixture(scope="session")
def md5_ahn3_fix():
yield {"C_01CZ1.LAZ": "063b23d038f97576d279fb7d8a1481ad"}
Expand Down
48 changes: 24 additions & 24 deletions packages/core/tests/test_assets_ahn.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,77 +48,77 @@ def test_get_checksums(url):
assert sha is not None


def test_checksums_for_ahn(context):
res = md5_ahn3(context)
def test_checksums_for_ahn(context_ahn):
res = md5_ahn3(context_ahn)
assert len(res) > 0
for k, sha in list(res.items())[:5]:
assert sha is not None
res = md5_ahn4(context)
res = md5_ahn4(context_ahn)
assert len(res) > 0
for k, sha in list(res.items())[:5]:
assert sha is not None
res = sha256_ahn5(context)
res = sha256_ahn5(context_ahn)
assert len(res) > 0
for k, sha in list(res.items())[:5]:
assert sha is not None


def test_tile_index_ahn(context):
res = tile_index_ahn(context)
def test_tile_index_ahn(context_ahn):
res = tile_index_ahn(context_ahn)
assert len(res) == 1407
assert res[list(res.keys())[0]] is not None


@pytest.mark.slow
def test_laz_files_ahn3(context, md5_ahn3_fix, tile_index_ahn_fix):
laz_dir = ahn_laz_dir(context.resources.file_store.file_store.data_dir, 3)
def test_laz_files_ahn3(context_ahn, md5_ahn3_fix, tile_index_ahn_fix):
laz_dir = ahn_laz_dir(context_ahn.resources.file_store.file_store.data_dir, 3)
laz_dir.mkdir(exist_ok=True, parents=True)
config = LazFilesConfig(force_download=False, check_hash=False)
res = laz_files_ahn3(context, config, md5_ahn3_fix, tile_index_ahn_fix)
res = laz_files_ahn3(context_ahn, config, md5_ahn3_fix, tile_index_ahn_fix)
assert res.value.url is not None
assert res is not None
print(res.value)


@pytest.mark.slow
def test_laz_files_ahn4(context, md5_ahn4_fix, tile_index_ahn_fix):
laz_dir = ahn_laz_dir(context.resources.file_store.file_store.data_dir, 4)
def test_laz_files_ahn4(context_ahn, md5_ahn4_fix, tile_index_ahn_fix):
laz_dir = ahn_laz_dir(context_ahn.resources.file_store.file_store.data_dir, 4)
laz_dir.mkdir(exist_ok=True, parents=True)
config = LazFilesConfig(force_download=False, check_hash=False)
res = laz_files_ahn4(context, config, md5_ahn4_fix, tile_index_ahn_fix)
res = laz_files_ahn4(context_ahn, config, md5_ahn4_fix, tile_index_ahn_fix)
assert res.value.url is not None
assert res is not None


@pytest.mark.slow
def test_laz_files_ahn5(context, sha256_ahn5_fix, tile_index_ahn_fix):
laz_dir = ahn_laz_dir(context.resources.file_store.file_store.data_dir, 5)
def test_laz_files_ahn5(context_ahn, sha256_ahn5_fix, tile_index_ahn_fix):
laz_dir = ahn_laz_dir(context_ahn.resources.file_store.file_store.data_dir, 5)
laz_dir.mkdir(exist_ok=True, parents=True)
config = LazFilesConfig(force_download=False, check_hash=False)
res = laz_files_ahn5(context, config, sha256_ahn5_fix, tile_index_ahn_fix)
res = laz_files_ahn5(context_ahn, config, sha256_ahn5_fix, tile_index_ahn_fix)
assert res.value.url is not None
assert res is not None


def test_metadata_table_ahn3(context):
metadata = metadata_table_ahn3(context)
def test_metadata_table_ahn3(context_ahn):
metadata = metadata_table_ahn3(context_ahn)
tbl = PostgresTableIdentifier("ahn", "metadata_ahn3")
assert table_exists(context, tbl)
assert table_exists(context_ahn, tbl)
assert isinstance(metadata, PostgresTableIdentifier)
assert str(metadata) == f"{tbl.schema}.{tbl.table}"


def test_metadata_table_ahn4(context):
metadata = metadata_table_ahn4(context)
def test_metadata_table_ahn4(context_ahn):
metadata = metadata_table_ahn4(context_ahn)
tbl = PostgresTableIdentifier("ahn", "metadata_ahn4")
assert table_exists(context, tbl)
assert table_exists(context_ahn, tbl)
assert isinstance(metadata, PostgresTableIdentifier)
assert str(metadata) == f"{tbl.schema}.{tbl.table}"


def test_metadata_table_ahn5(context):
metadata = metadata_table_ahn5(context)
def test_metadata_table_ahn5(context_ahn):
metadata = metadata_table_ahn5(context_ahn)
tbl = PostgresTableIdentifier("ahn", "metadata_ahn5")
assert table_exists(context, tbl)
assert table_exists(context_ahn, tbl)
assert isinstance(metadata, PostgresTableIdentifier)
assert str(metadata) == f"{tbl.schema}.{tbl.table}"
1 change: 0 additions & 1 deletion packages/core/tests/test_assets_top10nl.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,3 @@ def test_extract_top10nl(context_top10nl):
"""Does the complete asset work?"""
res = download.extract_top10nl(context_top10nl)
assert res.value.exists()
context_top10nl.resources.file_store.file_store.rm(force=True)
23 changes: 7 additions & 16 deletions packages/core/tests/test_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@


@pytest.mark.needs_tools
def test_integration_ahn(database, test_data_dir):
def test_integration_ahn(database, core_file_store):
"""Test the ahn jobs."""
resources = {
"lastools": LASToolsResource(
Expand All @@ -47,9 +47,7 @@ def test_integration_ahn(database, test_data_dir):
exe_pdal=os.getenv("EXE_PATH_PDAL"),
),
"db_connection": database,
"file_store": FileStoreResource(
data_dir=str(test_data_dir / "reconstruction_input")
),
"file_store": FileStoreResource(data_dir=str(core_file_store)),
}

all_ahn_assets = load_assets_from_package_module(
Expand Down Expand Up @@ -108,6 +106,8 @@ def test_integration_ahn(database, test_data_dir):
def test_integration_reconstruction_and_export(
database,
test_data_dir,
core_file_store,
core_file_store_fastssd,
mock_asset_reconstruction_input,
mock_asset_tiles,
mock_asset_index,
Expand All @@ -117,9 +117,7 @@ def test_integration_reconstruction_and_export(
):
# update quadtree
og_quadtree = test_data_dir / "quadtree.tsv"
export_dir = (
test_data_dir / "reconstruction_input" / "3DBAG" / "export_test_version"
)
export_dir = core_file_store / "3DBAG" / "export_test_version"
export_dir.mkdir(exist_ok=True)
os.system(f"cp {og_quadtree} {export_dir}")

Expand All @@ -143,12 +141,8 @@ def test_integration_reconstruction_and_export(
exe_sozip=os.getenv("EXE_PATH_SOZIP"),
),
"db_connection": database,
"file_store": FileStoreResource(
data_dir=str(test_data_dir / "reconstruction_input")
),
"file_store_fastssd": FileStoreResource(
data_dir=str(test_data_dir / "integration_core")
),
"file_store": FileStoreResource(data_dir=str(core_file_store)),
"file_store_fastssd": FileStoreResource(data_dir=str(core_file_store_fastssd)),
"version": VersionResource("test_version"),
"validation": ValidationResource(
exe_val3dity=os.getenv("EXE_PATH_VAL3DITY"),
Expand Down Expand Up @@ -203,7 +197,6 @@ def test_integration_reconstruction_and_export(
}
},
)

assert isinstance(result, ExecuteInProcessResult)
assert result.success

Expand All @@ -219,13 +212,11 @@ def test_integration_reconstruction_and_export(
}
},
)

assert isinstance(result, ExecuteInProcessResult)
assert result.success

resolved_job = defs.get_job_def("nl_export_after_floors")
result = resolved_job.execute_in_process(instance=instance, resources=resources)

assert isinstance(result, ExecuteInProcessResult)
assert result.success

Expand Down
Loading
Loading