Skip to content

Commit

Permalink
Merge branch 'develop' into bug_fix/multi_turbine_interactions
Browse files Browse the repository at this point in the history
  • Loading branch information
RHammond2 committed Dec 5, 2023
2 parents de50ad8 + 599f226 commit 1823592
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 14 deletions.
14 changes: 9 additions & 5 deletions floris/type_dec.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,12 @@ def iter_validator(iter_type, item_types: Union[Any, Tuple[Any]]) -> Callable:
return validator

def convert_to_path(fn: str | Path) -> Path:
"""Converts an input string or pathlib.Path object to a fully resolved ``pathlib.Path``
object.
"""
Converts an input string or ``pathlib.Path`` object to a fully resolved ``pathlib.Path``
object. If the input is a string, it is converted to a pathlib.Path object.
The function then checks if the path exists as an absolute path, a relative path from
the script, or a relative path from the system location. If the path does not exist in
any of these locations, a FileExistsError is raised.
Args:
fn (str | Path): The user input file path or file name.
Expand All @@ -113,11 +117,11 @@ def convert_to_path(fn: str | Path) -> Path:
absolute_fn = fn.resolve()
relative_fn_script = (base_fn_script / fn).resolve()
relative_fn_sys = (base_fn_sys / fn).resolve()
if absolute_fn.is_dir():
if absolute_fn.exists():
return absolute_fn
if relative_fn_script.is_dir():
if relative_fn_script.exists():
return relative_fn_script
if relative_fn_sys.is_dir():
if relative_fn_sys.exists():
return relative_fn_sys
raise FileExistsError(
f"{fn} could not be found as either a\n"
Expand Down
18 changes: 9 additions & 9 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,19 @@
REQUIRED = [
# simulation
"attrs",
"pyyaml",
"numexpr",
"numpy>=1.20",
"scipy>=1.1",
"pyyaml~=6.0",
"numexpr~=2.0",
"numpy~=1.20",
"scipy~=1.1",

# tools
"matplotlib>=3",
"pandas",
"shapely",
"matplotlib~=3.0",
"pandas~=2.0",
"shapely~=2.0",

# utilities
"coloredlogs>=10.0",
"flatten_dict",
"coloredlogs~=10.0",
"flatten_dict~=0.0",
]

# What packages are optional?
Expand Down

0 comments on commit 1823592

Please sign in to comment.