Skip to content

Commit

Permalink
Accessor (#204)
Browse files Browse the repository at this point in the history
* User-friendly error when setting manually ds.sections

Solves #200

* User-friendly error when setting manually ds.sections

Solves #200

* Revert accidental double implementation of sections.setter

* Update documentation of datastore class

* Removed numbagg from dependencies

llvmlite is a pain to install with pip. Alternatively, it could be installed with conda

* Explicitly pass sections to more functions

* Format

* Moving away from calibrate_double_ended() inplace

self.update(out) is still in place at the end

* Refactored calibrate_double_ended covariance calculation

* Parallel testing

* refactored variance functions

* Include pyupgrade flag of ruff

* Refactored single ended routine p_val to params and moved averaging routines

* Update .gitignore

* Refactored calibration routines

In preparation of the accessor

* Please ruff

* Refactored Datastore class

* Updated sections example notebook

* Updated example notebooks

* Add api to docs

* Unfortenate formatting of notebooks

* Estimate variance of stokes refactored

* single_ended_calibration and single_conf_ints working

* renamed conf_ints_single_ended to monte_carlo_single_ended

and calibration_single_ended to calibrate_ssingle_ended

* Removed DataStore from being used

* removed renaming_labels test

* conf_int_single renamed to monte_carlo_single

* Initial commit monte_carlo_double_ended

* Single and double ended calibration working and tested, including the monte carlo runs

* Got several variance_tests working

* Passing all variance tests

* Passing all tests except lint and examples

* Undo certain merge changes

* Minor cleanup

* Circumventing circular import DTSaccessor

* Update 03Define_sections.ipynb

* Update 04Calculate_variance_Stokes.ipynb

* Update 07Calibrate_single_ended.ipynb

* Update 08Calibrate_double_ended.ipynb

* calibration_double_ended to calibrate_double_ended

* Update 12Datastore_from_numpy_arrays.ipynb

* Update 13Fixed_parameter_calibration.ipynb

* Update 14Lossy_splices.ipynb

* Update 16Averaging_temperatures.ipynb

* Update 17Temperature_uncertainty_single_ended.ipynb

* Formatting of the entire repository

* Docs cleanup

* Fixed variance test

* Update test_variance_stokes.py

* Update 15Matching_sections.ipynb

* Updated 16Averaging notebook

* Update test_examples.py

* Update test_examples.py

* Fixing weirdly failing notebooks

* Update test_examples.py

* Rewritten test_notebooks routine

* Removed unused variable

* Remove metadata from notebook 12

* Delete 02Common_DataStore_functions_slice_mean_max_std_resample.ipynb

* Remove old reference to DataStore in notebooks

* Removed references to ds.variance_*() from docs

* Update src/dtscalibration/dts_accessor.py

Co-authored-by: Bart Schilperoort <[email protected]>

* Update test_examples.py

* Update docs

* Minimal attempt to fix docs

* Update README.rst

---------

Co-authored-by: Bart Schilperoort <[email protected]>
  • Loading branch information
bdestombe and BSchilperoort committed Oct 27, 2023
1 parent f7f3760 commit 588db04
Show file tree
Hide file tree
Showing 61 changed files with 4,117 additions and 5,665 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ output/*/index.html

# Sphinx
docs/_build
**/generated/**/*

.DS_Store
*~
Expand Down
1 change: 1 addition & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ Devices currently supported
Documentation
=============

* A full calibration procedure for single-ended setups is presented in notebook `07Calibrate_single_ended.ipynb <https://github.com/dtscalibration/python-dts-calibration/blob/main/docs/notebooks/07Calibrate_single_ended.ipynb>`_ and for double-ended setups in `08Calibrate_double_ended.ipynb <https://github.com/dtscalibration/python-dts-calibration/blob/main/docs/notebooks/08Calibrate_double_ended.ipynb>`_.
* Documentation at https://python-dts-calibration.readthedocs.io/ .
* Example notebooks that work within the browser can be viewed `here <https://python-dts-calibration.readthedocs.io/en/latest/learn_by_examples.html>`_.

Expand Down
7 changes: 0 additions & 7 deletions docs/api/dtscalibration.DataStore.rst

This file was deleted.

6 changes: 0 additions & 6 deletions docs/api/dtscalibration.check_dims.rst

This file was deleted.

6 changes: 0 additions & 6 deletions docs/api/dtscalibration.check_timestep_allclose.rst

This file was deleted.

6 changes: 0 additions & 6 deletions docs/api/dtscalibration.get_netcdf_encoding.rst

This file was deleted.

6 changes: 0 additions & 6 deletions docs/api/dtscalibration.merge_double_ended.rst

This file was deleted.

6 changes: 0 additions & 6 deletions docs/api/dtscalibration.open_datastore.rst

This file was deleted.

6 changes: 0 additions & 6 deletions docs/api/dtscalibration.open_mf_datastore.rst

This file was deleted.

6 changes: 0 additions & 6 deletions docs/api/dtscalibration.plot_accuracy.rst

This file was deleted.

This file was deleted.

6 changes: 0 additions & 6 deletions docs/api/dtscalibration.plot_residuals_reference_sections.rst

This file was deleted.

This file was deleted.

6 changes: 0 additions & 6 deletions docs/api/dtscalibration.plot_sigma_report.rst

This file was deleted.

6 changes: 0 additions & 6 deletions docs/api/dtscalibration.read_apsensing_files.rst

This file was deleted.

6 changes: 0 additions & 6 deletions docs/api/dtscalibration.read_sensornet_files.rst

This file was deleted.

6 changes: 0 additions & 6 deletions docs/api/dtscalibration.read_sensortran_files.rst

This file was deleted.

6 changes: 0 additions & 6 deletions docs/api/dtscalibration.read_silixa_files.rst

This file was deleted.

6 changes: 0 additions & 6 deletions docs/api/dtscalibration.shift_double_ended.rst

This file was deleted.

6 changes: 0 additions & 6 deletions docs/api/dtscalibration.suggest_cable_shift_double_ended.rst

This file was deleted.

15 changes: 10 additions & 5 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
# -*- coding: utf-8 -*-
from datetime import date
import os
from datetime import date

from xarray import Dataset # noqa: E402
import sphinx_autosummary_accessors

import dtscalibration # noqa: E402
from dtscalibration.dts_accessor import DtsAccessor # noqa: E402

extensions = [
"sphinx_rtd_theme",
Expand All @@ -15,6 +19,7 @@
"sphinx.ext.todo",
"sphinx.ext.viewcode",
"sphinx.ext.autosectionlabel",
"sphinx_autosummary_accessors",
"nbsphinx",
"sphinx.ext.mathjax",
"sphinx.ext.intersphinx",
Expand All @@ -41,11 +46,11 @@
project = "dtscalibration"
year = str(date.today().year)
author = "Bas des Tombe and Bart Schilperoort"
copyright = "{0}, {1}".format(year, author)
copyright = f"{year}, {author}"
version = release = "2.0.0"

pygments_style = "trac"
templates_path = ["."]
templates_path = [".", sphinx_autosummary_accessors.templates_path]
extlinks = {
"issue": (
"https://github.com/dtscalibration/python-dts-calibration/issues" "/%s",
Expand All @@ -63,7 +68,7 @@
html_sidebars = {
"**": ["searchbox.html", "globaltoc.html", "sourcelink.html"],
}
html_short_title = "%s-%s" % (project, version)
html_short_title = f"{project}-{version}"

napoleon_use_ivar = True
napoleon_use_rtype = False
Expand Down
24 changes: 5 additions & 19 deletions docs/notebooks/01Load_xml_measurement_files.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
"source": [
"# 1. Load your first measurement files\n",
"\n",
"The goal of this notebook is to show the different options of loading measurements from raw DTS files. These files are loaded into a `DataStore` object. This object has various methods for calibration, plotting. The current supported devices are:\n",
"The goal of this notebook is to show the different options of loading measurements from raw DTS files. These files are loaded into a `xarray.Dataset` object. This object has various methods for calibration, plotting. Both single-ended and double-ended measurements are supported. The current supported devices are:\n",
"- Silixa\n",
"- Sensornet\n",
"- AP Sensing\n",
"- Sensortran\n",
"\n",
"This example loads Silixa files. Both single-ended and double-ended measurements are supported. The first step is to load the correct read routine from `dtscalibration`.\n",
"- Silixa -> `dtscalibration.read_silixa_files`\n",
"- Sensornet -> `dtscalibration.read_sensornet_files`"
"See notebooks A2, A3, and A4."
]
},
{
Expand Down Expand Up @@ -125,20 +125,6 @@
"source": [
"print(ds)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
Expand All @@ -157,7 +143,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.5"
"version": "3.10.10"
}
},
"nbformat": 4,
Expand Down
Loading

0 comments on commit 588db04

Please sign in to comment.