Skip to content

Commit

Permalink
Use black to format notebooks
Browse files Browse the repository at this point in the history
  • Loading branch information
BSchilperoort committed Jul 29, 2023
1 parent f8b3ae6 commit efc6892
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,7 @@
"source": [
"# We use the logic from xarray to resample. However, it returns an xarray dataset type. Therefore we convert it back to the dtscalibration Datastore type.\n",
"from dtscalibration import DataStore\n",
"\n",
"ds_resampled = DataStore(ds.resample(time=\"47S\").mean())"
]
},
Expand Down
6 changes: 3 additions & 3 deletions docs/notebooks/09Import_timeseries.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,9 @@
},
"outputs": [],
"source": [
"ts = pd.read_csv(\n",
" filepath, sep=\",\", index_col=0, parse_dates=True\n",
")[\"Pt100 2\"] # See pandas' read_csv documentation for more options\n",
"ts = pd.read_csv(filepath, sep=\",\", index_col=0, parse_dates=True)[\n",
" \"Pt100 2\"\n",
"] # See pandas' read_csv documentation for more options\n",
"ts = ts.tz_localize(\"Europe/Amsterdam\") # Set the timezone"
]
},
Expand Down
5 changes: 1 addition & 4 deletions docs/notebooks/15Matching_sections.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -129,10 +129,7 @@
"rast_var, _ = ds_a.variance_stokes(st_label=\"rast\")\n",
"\n",
"ds_a.calibration_double_ended(\n",
" st_var=st_var,\n",
" ast_var=ast_var,\n",
" rst_var=rst_var,\n",
" rast_var=rast_var\n",
" st_var=st_var, ast_var=ast_var, rst_var=rst_var, rast_var=rast_var\n",
")\n",
"\n",
"ds_a.isel(time=0).tmpw.plot(label=\"calibrated\")"
Expand Down
9 changes: 4 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ dev = [
"bump2version",
"ruff",
"isort",
"black",
"black[jupyter]",
"mypy",
"types-PyYAML", # for pyyaml types
"types-xmltodict", # for xmltodict types
Expand Down Expand Up @@ -104,11 +104,11 @@ features = ["dev"]
[tool.hatch.envs.default.scripts]
lint = [
"ruff check .",
"black --check src/",
"black --check .",
"isort --check-only --diff .",
"mypy src/",
]
format = ["black src/", "isort .", "lint",]
format = ["black .", "isort .", "lint",]
test = ["pytest ./src/ ./tests/",] # --doctest-modules
coverage = [
"pytest --cov --cov-report term --cov-report xml --junitxml=xunit-result.xml tests/",
Expand Down Expand Up @@ -186,8 +186,7 @@ line_length = 120

[tool.black]
line-length = 88
target-version = ['py38', 'py39', 'py310']
include = '\.pyi?$'
target-version = ['py39', 'py310', 'py311']

[tool.mypy]
ignore_missing_imports = true # Preferably false, but matplotlib, scipy and statsmodels are missing typing stubs
Expand Down

0 comments on commit efc6892

Please sign in to comment.