-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updates the codebase to a recent commit (`2428726`). Squash-merged git history.
- Loading branch information
Showing
264 changed files
with
20,807 additions
and
7,657 deletions.
There are no files selected for viewing
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 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.
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 |
---|---|---|
@@ -1,41 +1,24 @@ | ||
repos: | ||
- repo: https://github.com/psf/black | ||
rev: 23.3.0 | ||
hooks: | ||
- id: black | ||
additional_dependencies: ["click==8.0.4"] | ||
- repo: https://github.com/astral-sh/ruff-pre-commit | ||
rev: v0.8.1 | ||
hooks: | ||
- id: ruff | ||
args: ["--fix", "--config", "fme/pyproject.toml"] | ||
- id: ruff-format | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v2.3.0 | ||
rev: v5.0.0 | ||
hooks: | ||
- id: check-added-large-files | ||
args: [--maxkb=250] | ||
- id: trailing-whitespace | ||
- id: flake8 | ||
name: flake8 | ||
language_version: python3 | ||
exclude: "__init__.py" | ||
args: [--config, setup.cfg] | ||
- id: flake8 | ||
name: flake8 __init__.py files | ||
files: "__init__.py" | ||
# ignore unused import error in __init__.py files | ||
args: ["--ignore=F401,E203,W503", --config, setup.cfg] | ||
- repo: https://github.com/pre-commit/mirrors-mypy | ||
rev: v1.2.0 | ||
hooks: | ||
- id: mypy | ||
additional_dependencies: ["types-PyYaml==5.4.3"] | ||
args: [ | ||
--follow-imports, silent, --ignore-missing-imports | ||
] | ||
args: ["--ignore-missing-imports", "--check-untyped-defs"] | ||
exclude: | | ||
(?x)^( | ||
.+/conf.py | | ||
.+/setup.py | | ||
.+/conftest.py | ||
)$ | ||
- repo: https://github.com/pycqa/isort | ||
rev: 5.11.5 | ||
hooks: | ||
- id: isort | ||
name: isort (python) | ||
)$ |
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 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 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,13 @@ | ||
# these are some packages which are convenient to have installed for ad-hoc analysis | ||
# but which are not requirements of the "fme" package. We do not relist the fme | ||
# dependencies here. | ||
beaker-py | ||
Bottleneck | ||
cartopy>=0.22.0 | ||
dask[distributed] | ||
ipywidgets | ||
nc-time-axis | ||
jupyterlab | ||
pyproj<3.7 | ||
seaborn | ||
bokeh>=3.1.0 |
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,68 @@ | ||
import signal | ||
|
||
import pytest | ||
|
||
|
||
def pytest_addoption(parser): | ||
parser.addoption( | ||
"--fast", | ||
action="store_true", | ||
default=False, | ||
help="Skip slow tests", | ||
) | ||
parser.addoption( | ||
"--very-fast", | ||
action="store_true", | ||
default=False, | ||
help="Run only very fast tests (< 5 seconds)", | ||
) | ||
|
||
|
||
@pytest.fixture | ||
def skip_slow(request, very_fast_only): | ||
return very_fast_only or request.config.getoption("--fast") | ||
|
||
|
||
@pytest.fixture | ||
def very_fast_only(request): | ||
return request.config.getoption("--very-fast") | ||
|
||
|
||
class TimeoutException(Exception): | ||
pass | ||
|
||
|
||
def timeout_handler(signum, frame): | ||
raise TimeoutException("Test took too long") | ||
|
||
|
||
@pytest.fixture | ||
def pdb_enabled(request): | ||
return request.config.getoption("--pdb") | ||
|
||
|
||
@pytest.fixture(autouse=True, scope="function") | ||
def enforce_timeout(skip_slow, very_fast_only, pdb_enabled): | ||
if pdb_enabled: | ||
yield # Do not enforce timeout if we are debugging | ||
return | ||
if very_fast_only: | ||
timeout_seconds = 3 | ||
elif skip_slow: | ||
timeout_seconds = 30 | ||
else: | ||
timeout_seconds = 60 | ||
signal.signal(signal.SIGALRM, timeout_handler) | ||
signal.alarm(timeout_seconds) # Set the timeout for the test | ||
try: | ||
yield | ||
finally: | ||
signal.alarm(0) # Disable the alarm after the test completes | ||
|
||
|
||
@pytest.hookimpl(tryfirst=True, hookwrapper=True) | ||
def pytest_runtest_call(item): | ||
try: | ||
yield | ||
except TimeoutException: | ||
pytest.fail("Test failed due to timeout") |
This file was deleted.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,21 @@ | ||
body[data-theme="dark"] { | ||
--code-block-background: #202020; | ||
} | ||
|
||
body[data-theme="light"] { | ||
--code-block-background: #f8f9fb; | ||
} | ||
|
||
body[data-theme="auto"] { | ||
--code-block-background: #f8f9fb; | ||
} | ||
|
||
@media (prefers-color-scheme: dark) { | ||
body[data-theme="auto"] { | ||
--code-block-background: #202020; | ||
} | ||
} | ||
|
||
div.highlight pre { | ||
background: var(--code-block-background); | ||
} |
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 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 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,3 @@ | ||
path: initial_conditions.nc | ||
start_indices: | ||
list: [0, 3, 7] |
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,5 @@ | ||
path: initial_conditions.nc | ||
start_indices: | ||
n_initial_conditions: 3 | ||
first: 1 | ||
interval: 2 |
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,5 @@ | ||
path: initial_conditions.nc | ||
start_indices: | ||
times: | ||
- "2021-01-01T00:00:00" | ||
- "2021-02-01T00:00:00" |
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
Oops, something went wrong.