Skip to content

Commit

Permalink
ENH: default location to store STLs to is users home
Browse files Browse the repository at this point in the history
  • Loading branch information
fgebhart committed Feb 6, 2022
1 parent f0d05d6 commit 0d91134
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 3 additions & 2 deletions mapa/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from pathlib import Path
from typing import Union

import click
import numpy as np
Expand Down Expand Up @@ -92,15 +93,15 @@ def convert_tif_to_stl(
input_file: str,
as_ascii: bool,
model_size: int,
output_file: str,
output_file: Union[str, None],
max_res: bool,
z_offset: float,
z_scale: float,
make_square: bool,
) -> Path:
_verify_input_is_valid(input_file)
if output_file is None:
output_file = Path.cwd() / str(Path(input_file).name).replace(".tiff", ".stl").replace(".tif", ".stl")
output_file = Path.home() / str(Path(input_file).name).replace(".tiff", ".stl").replace(".tif", ".stl")
_verify_output_is_valid(output_file)

tiff = rio.open(input_file)
Expand Down
3 changes: 2 additions & 1 deletion mapa/cli.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import subprocess
from pathlib import Path
from typing import Union

import click

Expand Down Expand Up @@ -51,7 +52,7 @@
@click.version_option()
def dem2stl(
input: str,
output: str,
output: Union[str, None],
z_offset: float,
z_scale: float,
max_res: bool = False,
Expand Down

0 comments on commit 0d91134

Please sign in to comment.