Skip to content

Commit

Permalink
Merge pull request #30 from IGNF/fix-decorator
Browse files Browse the repository at this point in the history
Fix copy_and_hack_decorator + version 1.4.1
  • Loading branch information
leavauchier authored Nov 2, 2023
2 parents 7dbc37b + d924d3a commit fd33cd0
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# 1.4.1
- fix copy_and_hack_decorator (was not returning the decorated function output)

# 1.4.0
- count_occurences / replace_value: add copy_and_hack decorator to run on tscan output files
- Update to pdal 2.6+ to better handle classification values and flags in replace_attribute_in_las
Expand Down
2 changes: 1 addition & 1 deletion pdaltools/_version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = "1.4.0"
__version__ = "1.4.1"


if __name__ == "__main__":
Expand Down
3 changes: 2 additions & 1 deletion pdaltools/unlock_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ def newfn(*args, **kwargs):
with tempfile.NamedTemporaryFile(suffix=os.path.splitext(in_file)[-1]) as tmp:
copy_and_hack_input_file(in_file, tmp.name)
args[0] = tmp.name
func(*args, **kwargs)

return func(*args, **kwargs)

else:
raise e
Expand Down
3 changes: 2 additions & 1 deletion test/test_unlock.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ def decorated_pdal_info_json(input_file: str):
def test_copy_and_hack_decorator_simple():
TMP_FILE = os.path.join(TMPDIR, "copy_and_hack_simple.laz")
shutil.copy(LAZ_FILE, TMP_FILE)
decorated_pdal_info_json(TMP_FILE)
ret = decorated_pdal_info_json(TMP_FILE)
assert ret # Check that the return value of the decorated function is returned


@pytest.mark.geoportail
Expand Down

0 comments on commit fd33cd0

Please sign in to comment.