diff --git a/.buildinfo b/.buildinfo index 14d6376a..9da9e883 100644 --- a/.buildinfo +++ b/.buildinfo @@ -1,4 +1,4 @@ # Sphinx build info version 1 # This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done. -config: 83fc8b3d93aabf933981e660f670aecf +config: f3accd61f28ed912573026661e4390b3 tags: 645f666f9bcd5a90fca523b33c5a78b7 diff --git a/.doctrees/auto_examples/load_and_explore_poses.doctree b/.doctrees/auto_examples/load_and_explore_poses.doctree index 99ba1a63..8a8b04fb 100644 Binary files a/.doctrees/auto_examples/load_and_explore_poses.doctree and b/.doctrees/auto_examples/load_and_explore_poses.doctree differ diff --git a/.doctrees/auto_examples/sg_execution_times.doctree b/.doctrees/auto_examples/sg_execution_times.doctree index 0a9e92f9..e4661dae 100644 Binary files a/.doctrees/auto_examples/sg_execution_times.doctree and b/.doctrees/auto_examples/sg_execution_times.doctree differ diff --git a/.doctrees/contributing.doctree b/.doctrees/contributing.doctree index 2e82cf73..4fca8a18 100644 Binary files a/.doctrees/contributing.doctree and b/.doctrees/contributing.doctree differ diff --git a/.doctrees/environment.pickle b/.doctrees/environment.pickle index b781c3a9..1f658bde 100644 Binary files a/.doctrees/environment.pickle and b/.doctrees/environment.pickle differ diff --git a/_downloads/07fcc19ba03226cd3d83d4e40ec44385/auto_examples_python.zip b/_downloads/07fcc19ba03226cd3d83d4e40ec44385/auto_examples_python.zip index 772f52d1..81f4f349 100644 Binary files a/_downloads/07fcc19ba03226cd3d83d4e40ec44385/auto_examples_python.zip and b/_downloads/07fcc19ba03226cd3d83d4e40ec44385/auto_examples_python.zip differ diff --git a/_downloads/6f1e7a639e0699d6164445b55e6c116d/auto_examples_jupyter.zip b/_downloads/6f1e7a639e0699d6164445b55e6c116d/auto_examples_jupyter.zip index afae95ad..c0d0720e 100644 Binary files a/_downloads/6f1e7a639e0699d6164445b55e6c116d/auto_examples_jupyter.zip and b/_downloads/6f1e7a639e0699d6164445b55e6c116d/auto_examples_jupyter.zip differ diff --git a/_modules/index.html b/_modules/index.html index 81767b1f..d78eb93f 100644 --- a/_modules/index.html +++ b/_modules/index.html @@ -39,7 +39,7 @@ - + @@ -119,7 +119,7 @@ -

movement v0.0.7

+

movement v0.0.8

diff --git a/_modules/movement/datasets.html b/_modules/movement/datasets.html index 2430ff23..61f35291 100644 --- a/_modules/movement/datasets.html +++ b/_modules/movement/datasets.html @@ -39,7 +39,7 @@ - + @@ -119,7 +119,7 @@ -

movement v0.0.7

+

movement v0.0.8

diff --git a/_modules/movement/io/load_poses.html b/_modules/movement/io/load_poses.html index bbd78719..74a8db7e 100644 --- a/_modules/movement/io/load_poses.html +++ b/_modules/movement/io/load_poses.html @@ -39,7 +39,7 @@ - + @@ -119,7 +119,7 @@ -

movement v0.0.7

+

movement v0.0.8

diff --git a/_modules/movement/io/save_poses.html b/_modules/movement/io/save_poses.html index 2ecf0c35..6dfb7537 100644 --- a/_modules/movement/io/save_poses.html +++ b/_modules/movement/io/save_poses.html @@ -39,7 +39,7 @@ - + @@ -119,7 +119,7 @@ -

movement v0.0.7

+

movement v0.0.8

diff --git a/_modules/movement/io/validators.html b/_modules/movement/io/validators.html index 4014f12e..64c1832a 100644 --- a/_modules/movement/io/validators.html +++ b/_modules/movement/io/validators.html @@ -39,7 +39,7 @@ - + @@ -119,7 +119,7 @@ -

movement v0.0.7

+

movement v0.0.8

diff --git a/_modules/movement/logging.html b/_modules/movement/logging.html index b12f7887..d2b785c1 100644 --- a/_modules/movement/logging.html +++ b/_modules/movement/logging.html @@ -39,7 +39,7 @@ - + @@ -119,7 +119,7 @@ -

movement v0.0.7

+

movement v0.0.8

@@ -411,34 +411,37 @@

Source code for movement.logging

 
     # Set the log directory and file path
     log_directory.mkdir(parents=True, exist_ok=True)
-    log_file = log_directory / f"{logger_name}.log"
-
-    # If a logger with the given name is already configured
-    if logger_name in logging.root.manager.loggerDict:
-        logger = logging.getLogger(logger_name)
-        handlers = logger.handlers[:]
-        # If the log file path has changed
-        if log_file.as_posix() != handlers[0].baseFilename:  # type: ignore
-            # remove the handlers to allow for reconfiguration
-            for handler in handlers:
-                logger.removeHandler(handler)
-        else:
-            # otherwise, do nothing
-            return
+    log_file = (log_directory / f"{logger_name}.log").as_posix()
+
+    # Check if logger with the given name is already configured
+    logger_configured = logger_name in logging.root.manager.loggerDict
 
     logger = logging.getLogger(logger_name)
-    logger.setLevel(log_level)
 
-    # Create a rotating file handler
-    max_log_size = 5 * 1024 * 1024  # 5 MB
-    handler = RotatingFileHandler(log_file, maxBytes=max_log_size)
+    # Logger needs to be (re)configured if unconfigured or
+    # if configured but the log file path has changed
+    configure_logger = (
+        not logger_configured
+        or log_file != logger.handlers[0].baseFilename  # type: ignore
+    )
+
+    if configure_logger:
+        if logger_configured:
+            # remove the handlers to allow for reconfiguration
+            logger.handlers.clear()
+
+        logger.setLevel(log_level)
+
+        # Create a rotating file handler
+        max_log_size = 5 * 1024 * 1024  # 5 MB
+        handler = RotatingFileHandler(log_file, maxBytes=max_log_size)
 
-    # Create a formatter and set it to the handler
-    formatter = logging.Formatter(FORMAT)
-    handler.setFormatter(formatter)
+        # Create a formatter and set it to the handler
+        formatter = logging.Formatter(FORMAT)
+        handler.setFormatter(formatter)
 
-    # Add the handler to the logger
-    logger.addHandler(handler)
+ # Add the handler to the logger + logger.addHandler(handler)
[docs]def log_error(error, message: str, logger_name: str = "movement"): diff --git a/_sources/auto_examples/load_and_explore_poses.rst.txt b/_sources/auto_examples/load_and_explore_poses.rst.txt index d613b8ba..997be28a 100644 --- a/_sources/auto_examples/load_and_explore_poses.rst.txt +++ b/_sources/auto_examples/load_and_explore_poses.rst.txt @@ -102,7 +102,7 @@ e.g., ``file_path = "/path/to/my/data.h5"``) .. code-block:: none - 0.00B [00:00, ?B/s] 34.8kB [00:00, 246kB/s] 0.00B [00:00, ?B/s] 0.00B [00:00, ?B/s] + 0.00B [00:00, ?B/s] 34.8kB [00:00, 253kB/s] 0.00B [00:00, ?B/s] 0.00B [00:00, ?B/s] @@ -226,7 +226,7 @@ using ``xarray``'s built-in plotting methods: .. code-block:: none - + @@ -257,7 +257,7 @@ for all individuals: .. code-block:: none - + @@ -301,14 +301,14 @@ For example, we can use ``matplotlib`` to plot trajectories .. code-block:: none - + .. rst-class:: sphx-glr-timing - **Total running time of the script:** (0 minutes 1.595 seconds) + **Total running time of the script:** (0 minutes 1.882 seconds) .. _sphx_glr_download_auto_examples_load_and_explore_poses.py: diff --git a/_sources/auto_examples/sg_execution_times.rst.txt b/_sources/auto_examples/sg_execution_times.rst.txt index 66cce400..8f60e2c3 100644 --- a/_sources/auto_examples/sg_execution_times.rst.txt +++ b/_sources/auto_examples/sg_execution_times.rst.txt @@ -6,8 +6,8 @@ Computation times ================= -**00:01.595** total execution time for **auto_examples** files: +**00:01.882** total execution time for **auto_examples** files: +-----------------------------------------------------------------------------------------+-----------+--------+ -| :ref:`sphx_glr_auto_examples_load_and_explore_poses.py` (``load_and_explore_poses.py``) | 00:01.595 | 0.0 MB | +| :ref:`sphx_glr_auto_examples_load_and_explore_poses.py` (``load_and_explore_poses.py``) | 00:01.882 | 0.0 MB | +-----------------------------------------------------------------------------------------+-----------+--------+ diff --git a/_static/documentation_options.js b/_static/documentation_options.js index 6543c2a9..dc824558 100644 --- a/_static/documentation_options.js +++ b/_static/documentation_options.js @@ -1,6 +1,6 @@ var DOCUMENTATION_OPTIONS = { URL_ROOT: document.getElementById("documentation_options").getAttribute('data-url_root'), - VERSION: '0.0.7', + VERSION: '0.0.8', LANGUAGE: 'en', COLLAPSE_INDEX: false, BUILDER: 'html', diff --git a/api_index.html b/api_index.html index 92567314..7d2c6e38 100644 --- a/api_index.html +++ b/api_index.html @@ -40,7 +40,7 @@ - + @@ -122,7 +122,7 @@ -

movement v0.0.7

+

movement v0.0.8

diff --git a/auto_api/movement.datasets.fetch_pose_data_path.html b/auto_api/movement.datasets.fetch_pose_data_path.html index 05260e12..46312a08 100644 --- a/auto_api/movement.datasets.fetch_pose_data_path.html +++ b/auto_api/movement.datasets.fetch_pose_data_path.html @@ -40,7 +40,7 @@ - + @@ -122,7 +122,7 @@ -

movement v0.0.7

+

movement v0.0.8

diff --git a/auto_api/movement.datasets.list_pose_data.html b/auto_api/movement.datasets.list_pose_data.html index d978d2d0..e9b1b9ab 100644 --- a/auto_api/movement.datasets.list_pose_data.html +++ b/auto_api/movement.datasets.list_pose_data.html @@ -40,7 +40,7 @@ - + @@ -122,7 +122,7 @@ -

movement v0.0.7

+

movement v0.0.8

diff --git a/auto_api/movement.io.load_poses.from_dlc_df.html b/auto_api/movement.io.load_poses.from_dlc_df.html index 6ba1d83c..5116ddb3 100644 --- a/auto_api/movement.io.load_poses.from_dlc_df.html +++ b/auto_api/movement.io.load_poses.from_dlc_df.html @@ -40,7 +40,7 @@ - + @@ -122,7 +122,7 @@ -

movement v0.0.7

+

movement v0.0.8

diff --git a/auto_api/movement.io.load_poses.from_dlc_file.html b/auto_api/movement.io.load_poses.from_dlc_file.html index fee2217d..6289d693 100644 --- a/auto_api/movement.io.load_poses.from_dlc_file.html +++ b/auto_api/movement.io.load_poses.from_dlc_file.html @@ -40,7 +40,7 @@ - + @@ -122,7 +122,7 @@ -

movement v0.0.7

+

movement v0.0.8

diff --git a/auto_api/movement.io.load_poses.from_sleap_file.html b/auto_api/movement.io.load_poses.from_sleap_file.html index 8ffdc35e..c261e891 100644 --- a/auto_api/movement.io.load_poses.from_sleap_file.html +++ b/auto_api/movement.io.load_poses.from_sleap_file.html @@ -40,7 +40,7 @@ - + @@ -122,7 +122,7 @@ -

movement v0.0.7

+

movement v0.0.8

diff --git a/auto_api/movement.io.save_poses.to_dlc_df.html b/auto_api/movement.io.save_poses.to_dlc_df.html index cb0b60e9..120b0689 100644 --- a/auto_api/movement.io.save_poses.to_dlc_df.html +++ b/auto_api/movement.io.save_poses.to_dlc_df.html @@ -40,7 +40,7 @@ - + @@ -122,7 +122,7 @@ -

movement v0.0.7

+

movement v0.0.8

diff --git a/auto_api/movement.io.save_poses.to_dlc_file.html b/auto_api/movement.io.save_poses.to_dlc_file.html index aae9ee46..79273a5e 100644 --- a/auto_api/movement.io.save_poses.to_dlc_file.html +++ b/auto_api/movement.io.save_poses.to_dlc_file.html @@ -40,7 +40,7 @@ - + @@ -122,7 +122,7 @@ -

movement v0.0.7

+

movement v0.0.8

diff --git a/auto_api/movement.io.validators.ValidFile.html b/auto_api/movement.io.validators.ValidFile.html index 1077b9ab..30be2092 100644 --- a/auto_api/movement.io.validators.ValidFile.html +++ b/auto_api/movement.io.validators.ValidFile.html @@ -40,7 +40,7 @@ - + @@ -122,7 +122,7 @@ -

movement v0.0.7

+

movement v0.0.8

diff --git a/auto_api/movement.io.validators.ValidHDF5.html b/auto_api/movement.io.validators.ValidHDF5.html index 7ee7e921..582354ee 100644 --- a/auto_api/movement.io.validators.ValidHDF5.html +++ b/auto_api/movement.io.validators.ValidHDF5.html @@ -40,7 +40,7 @@ - + @@ -122,7 +122,7 @@ -

movement v0.0.7

+

movement v0.0.8

diff --git a/auto_api/movement.io.validators.ValidPoseTracks.html b/auto_api/movement.io.validators.ValidPoseTracks.html index f266268e..eb9c48a7 100644 --- a/auto_api/movement.io.validators.ValidPoseTracks.html +++ b/auto_api/movement.io.validators.ValidPoseTracks.html @@ -40,7 +40,7 @@ - + @@ -122,7 +122,7 @@ -

movement v0.0.7

+

movement v0.0.8

diff --git a/auto_api/movement.io.validators.ValidPosesCSV.html b/auto_api/movement.io.validators.ValidPosesCSV.html index 5dd59147..5ee6b7dd 100644 --- a/auto_api/movement.io.validators.ValidPosesCSV.html +++ b/auto_api/movement.io.validators.ValidPosesCSV.html @@ -40,7 +40,7 @@ - + @@ -122,7 +122,7 @@ -

movement v0.0.7

+

movement v0.0.8

diff --git a/auto_api/movement.logging.configure_logging.html b/auto_api/movement.logging.configure_logging.html index ad4e5473..56792104 100644 --- a/auto_api/movement.logging.configure_logging.html +++ b/auto_api/movement.logging.configure_logging.html @@ -40,7 +40,7 @@ - + @@ -122,7 +122,7 @@ -

movement v0.0.7

+

movement v0.0.8

diff --git a/auto_api/movement.logging.log_error.html b/auto_api/movement.logging.log_error.html index f67aa0f2..b66ae6a7 100644 --- a/auto_api/movement.logging.log_error.html +++ b/auto_api/movement.logging.log_error.html @@ -40,7 +40,7 @@ - + @@ -122,7 +122,7 @@ -

movement v0.0.7

+

movement v0.0.8

diff --git a/auto_api/movement.logging.log_warning.html b/auto_api/movement.logging.log_warning.html index 84c01e72..9fba48d6 100644 --- a/auto_api/movement.logging.log_warning.html +++ b/auto_api/movement.logging.log_warning.html @@ -40,7 +40,7 @@ - + @@ -122,7 +122,7 @@ -

movement v0.0.7

+

movement v0.0.8

diff --git a/auto_examples/index.html b/auto_examples/index.html index f747f301..dfef2f10 100644 --- a/auto_examples/index.html +++ b/auto_examples/index.html @@ -40,7 +40,7 @@ - + @@ -122,7 +122,7 @@ -

movement v0.0.7

+

movement v0.0.8

diff --git a/auto_examples/load_and_explore_poses.html b/auto_examples/load_and_explore_poses.html index 843a3a2f..0559f90c 100644 --- a/auto_examples/load_and_explore_poses.html +++ b/auto_examples/load_and_explore_poses.html @@ -40,7 +40,7 @@ - + @@ -122,7 +122,7 @@ -

movement v0.0.7

+

movement v0.0.8

@@ -440,7 +440,7 @@

Fetch an example dataset
0.00B [00:00, ?B/s]
-34.8kB [00:00, 246kB/s]
+34.8kB [00:00, 253kB/s]
 0.00B [00:00, ?B/s]
 0.00B [00:00, ?B/s]
 
@@ -499,7 +499,7 @@

Select and plot data with xarray
da.plot.line(x="time", row="space", aspect=2, size=2.5)
 
-space = x, space = y
-individuals = AEON3B_NTP, individuals = AEON3B_TP1, individuals = AEON3B_TP2 -Trajectory of AEON3B_TP1
<matplotlib.colorbar.Colorbar object at 0x7f2813b5f050>
+Trajectory of AEON3B_TP1
<matplotlib.colorbar.Colorbar object at 0x7fc24b938510>
 
-

Total running time of the script: (0 minutes 1.595 seconds)

+

Total running time of the script: (0 minutes 1.882 seconds)