-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #131 from tataratat/no-splines
move spline functionalities to splinepy
- Loading branch information
Showing
40 changed files
with
130 additions
and
8,103 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
samples |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
"""Helper file for examples. Loads sample files from the tataratat/samples.""" | ||
import pathlib | ||
|
||
import requests | ||
|
||
base_url = "https://raw.githubusercontent.com/tataratat/samples/main/" | ||
local_path = pathlib.Path(__file__).parent / "samples/" | ||
|
||
|
||
def load_sample_file(filename: str, force_reload: bool = False) -> bool: | ||
"""Loads a sample file from the tataratat/samples repository. | ||
Args: | ||
filename (str): Path of the file to load. | ||
force_reload (bool, optional): Loads the file even if it already | ||
exists. Defaults to False. | ||
Returns: | ||
bool: File could be loaded. | ||
""" | ||
local_file = local_path / filename | ||
if local_file.exists() and not force_reload: | ||
return True | ||
pathlib.Path.mkdir(local_file.parent, parents=True, exist_ok=True) | ||
|
||
url = base_url + filename | ||
response = requests.get(url) | ||
if response.status_code == 200: | ||
with open(local_file, "wb") as f: | ||
f.write(response.content) | ||
return True | ||
else: | ||
print(f"Cant load {url}, status code: {response.status_code}.") | ||
return False |
Submodule samples
deleted from
170914
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.