cellpy 0.4.2.post4__tar.gz → 0.4.2.post6__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (155) hide show
  1. {cellpy-0.4.2.post4 → cellpy-0.4.2.post6}/PKG-INFO +1 -1
  2. cellpy-0.4.2.post6/cellpy/_version.py +1 -0
  3. {cellpy-0.4.2.post4 → cellpy-0.4.2.post6}/cellpy/log.py +141 -141
  4. {cellpy-0.4.2.post4 → cellpy-0.4.2.post6}/cellpy/readers/instruments/arbin_res.py +8 -9
  5. {cellpy-0.4.2.post4 → cellpy-0.4.2.post6}/cellpy.egg-info/PKG-INFO +1 -1
  6. {cellpy-0.4.2.post4 → cellpy-0.4.2.post6}/cellpy.egg-info/SOURCES.txt +17 -9
  7. cellpy-0.4.2.post6/docs/_build/.doctrees/nbsphinx/examples_and_tutorials_notebooks_tutorial_simple_plot_2_0.png +0 -0
  8. cellpy-0.4.2.post6/docs/_build/_images/examples_and_tutorials_notebooks_tutorial_simple_plot_2_0.png +0 -0
  9. cellpy-0.4.2.post6/docs/_build/_images/graphviz-22185705e237fa530df24e4af50cb25833165e25.png +0 -0
  10. cellpy-0.4.2.post6/docs/_build/_images/graphviz-246f2486cd940f2ea40a07f847c86c22b2607ca8.png +0 -0
  11. cellpy-0.4.2.post6/docs/_build/_images/graphviz-42e9bc826d476a3d361a7f410e989ed34dc1aa85.png +0 -0
  12. cellpy-0.4.2.post6/docs/_build/_images/graphviz-619216a42370fd49669c083549129b8470c8fae1.png +0 -0
  13. cellpy-0.4.2.post6/docs/_build/_images/graphviz-6deb64a460668e8ef9bf0ca653314119adeeae66.png +0 -0
  14. cellpy-0.4.2.post6/docs/_build/_images/graphviz-83b62e03ef369ff0a30f027892dba95b91ea8b6c.png +0 -0
  15. cellpy-0.4.2.post6/docs/_build/_images/graphviz-ce8a9fe2ba01194aed847e0248d749db4093aca1.png +0 -0
  16. cellpy-0.4.2.post6/docs/_build/_images/graphviz-e94a5352318e02fcc5ef1f813e02a526c39af791.png +0 -0
  17. cellpy-0.4.2.post6/docs/adapted_readme.rst +57 -0
  18. {cellpy-0.4.2.post4 → cellpy-0.4.2.post6}/docs/conf.py +332 -327
  19. {cellpy-0.4.2.post4 → cellpy-0.4.2.post6}/docs/index.rst +51 -51
  20. cellpy-0.4.2.post4/cellpy/_version.py +0 -1
  21. cellpy-0.4.2.post4/docs/_build/.doctrees/nbsphinx/notebooks_tutorial_simple_plot_2_0.png +0 -0
  22. cellpy-0.4.2.post4/docs/_build/_images/notebooks_tutorial_simple_plot_2_0.png +0 -0
  23. cellpy-0.4.2.post4/docs/readme.rst +0 -1
  24. {cellpy-0.4.2.post4 → cellpy-0.4.2.post6}/AUTHORS.rst +0 -0
  25. {cellpy-0.4.2.post4 → cellpy-0.4.2.post6}/CONTRIBUTING.rst +0 -0
  26. {cellpy-0.4.2.post4 → cellpy-0.4.2.post6}/HISTORY.rst +0 -0
  27. {cellpy-0.4.2.post4 → cellpy-0.4.2.post6}/LICENSE +0 -0
  28. {cellpy-0.4.2.post4 → cellpy-0.4.2.post6}/MANIFEST.in +0 -0
  29. {cellpy-0.4.2.post4 → cellpy-0.4.2.post6}/README.rst +0 -0
  30. {cellpy-0.4.2.post4 → cellpy-0.4.2.post6}/cellpy/__init__.py +0 -0
  31. {cellpy-0.4.2.post4 → cellpy-0.4.2.post6}/cellpy/cli.py +0 -0
  32. {cellpy-0.4.2.post4 → cellpy-0.4.2.post6}/cellpy/exceptions.py +0 -0
  33. {cellpy-0.4.2.post4 → cellpy-0.4.2.post6}/cellpy/logging.json +0 -0
  34. {cellpy-0.4.2.post4 → cellpy-0.4.2.post6}/cellpy/parameters/.cellpy_prms_default.conf +0 -0
  35. {cellpy-0.4.2.post4 → cellpy-0.4.2.post6}/cellpy/parameters/__init__.py +0 -0
  36. {cellpy-0.4.2.post4 → cellpy-0.4.2.post6}/cellpy/parameters/internal_settings.py +0 -0
  37. {cellpy-0.4.2.post4 → cellpy-0.4.2.post6}/cellpy/parameters/internal_settings_old.py +0 -0
  38. {cellpy-0.4.2.post4 → cellpy-0.4.2.post6}/cellpy/parameters/legacy/__init__.py +0 -0
  39. {cellpy-0.4.2.post4 → cellpy-0.4.2.post6}/cellpy/parameters/legacy/internal_settings.py +0 -0
  40. {cellpy-0.4.2.post4 → cellpy-0.4.2.post6}/cellpy/parameters/prmreader.py +0 -0
  41. {cellpy-0.4.2.post4 → cellpy-0.4.2.post6}/cellpy/parameters/prms.py +0 -0
  42. {cellpy-0.4.2.post4 → cellpy-0.4.2.post6}/cellpy/readers/__init__.py +0 -0
  43. {cellpy-0.4.2.post4 → cellpy-0.4.2.post6}/cellpy/readers/cellreader.py +0 -0
  44. {cellpy-0.4.2.post4 → cellpy-0.4.2.post6}/cellpy/readers/core.py +0 -0
  45. {cellpy-0.4.2.post4 → cellpy-0.4.2.post6}/cellpy/readers/dbreader.py +0 -0
  46. {cellpy-0.4.2.post4 → cellpy-0.4.2.post6}/cellpy/readers/filefinder.py +0 -0
  47. {cellpy-0.4.2.post4 → cellpy-0.4.2.post6}/cellpy/readers/instruments/__init__.py +0 -0
  48. {cellpy-0.4.2.post4 → cellpy-0.4.2.post6}/cellpy/readers/instruments/arbin_sql.py +0 -0
  49. {cellpy-0.4.2.post4 → cellpy-0.4.2.post6}/cellpy/readers/instruments/arbin_sql_csv.py +0 -0
  50. {cellpy-0.4.2.post4 → cellpy-0.4.2.post6}/cellpy/readers/instruments/arbin_sql_xlsx.py +0 -0
  51. {cellpy-0.4.2.post4 → cellpy-0.4.2.post6}/cellpy/readers/instruments/backup_arbin.py +0 -0
  52. {cellpy-0.4.2.post4 → cellpy-0.4.2.post6}/cellpy/readers/instruments/base.py +0 -0
  53. {cellpy-0.4.2.post4 → cellpy-0.4.2.post6}/cellpy/readers/instruments/biologics_mpr.py +0 -0
  54. {cellpy-0.4.2.post4 → cellpy-0.4.2.post6}/cellpy/readers/instruments/configurations/__init__.py +0 -0
  55. {cellpy-0.4.2.post4 → cellpy-0.4.2.post6}/cellpy/readers/instruments/configurations/maccor_txt_four.py +0 -0
  56. {cellpy-0.4.2.post4 → cellpy-0.4.2.post6}/cellpy/readers/instruments/configurations/maccor_txt_one.py +0 -0
  57. {cellpy-0.4.2.post4 → cellpy-0.4.2.post6}/cellpy/readers/instruments/configurations/maccor_txt_three.py +0 -0
  58. {cellpy-0.4.2.post4 → cellpy-0.4.2.post6}/cellpy/readers/instruments/configurations/maccor_txt_two.py +0 -0
  59. {cellpy-0.4.2.post4 → cellpy-0.4.2.post6}/cellpy/readers/instruments/configurations/maccor_txt_zero.py +0 -0
  60. {cellpy-0.4.2.post4 → cellpy-0.4.2.post6}/cellpy/readers/instruments/custom.py +0 -0
  61. {cellpy-0.4.2.post4 → cellpy-0.4.2.post6}/cellpy/readers/instruments/delete_these_in_february2022/__init__.py +0 -0
  62. {cellpy-0.4.2.post4 → cellpy-0.4.2.post6}/cellpy/readers/instruments/delete_these_in_february2022/_testing_txt.py +0 -0
  63. {cellpy-0.4.2.post4 → cellpy-0.4.2.post6}/cellpy/readers/instruments/delete_these_in_february2022/maccor_txt_old.py +0 -0
  64. {cellpy-0.4.2.post4 → cellpy-0.4.2.post6}/cellpy/readers/instruments/ext_nda_reader.py +0 -0
  65. {cellpy-0.4.2.post4 → cellpy-0.4.2.post6}/cellpy/readers/instruments/loader_specific_modules/__init__.py +0 -0
  66. {cellpy-0.4.2.post4 → cellpy-0.4.2.post6}/cellpy/readers/instruments/loader_specific_modules/biologic_file_format.py +0 -0
  67. {cellpy-0.4.2.post4 → cellpy-0.4.2.post6}/cellpy/readers/instruments/local_instrument.py +0 -0
  68. {cellpy-0.4.2.post4 → cellpy-0.4.2.post6}/cellpy/readers/instruments/maccor_txt.py +0 -0
  69. {cellpy-0.4.2.post4 → cellpy-0.4.2.post6}/cellpy/readers/instruments/old_custom.py +0 -0
  70. {cellpy-0.4.2.post4 → cellpy-0.4.2.post6}/cellpy/readers/instruments/pec_csv.py +0 -0
  71. {cellpy-0.4.2.post4 → cellpy-0.4.2.post6}/cellpy/readers/instruments/processors/__init__.py +0 -0
  72. {cellpy-0.4.2.post4 → cellpy-0.4.2.post6}/cellpy/readers/instruments/processors/post_processors.py +0 -0
  73. {cellpy-0.4.2.post4 → cellpy-0.4.2.post6}/cellpy/readers/instruments/processors/pre_processors.py +0 -0
  74. {cellpy-0.4.2.post4 → cellpy-0.4.2.post6}/cellpy/utils/__init__.py +0 -0
  75. {cellpy-0.4.2.post4 → cellpy-0.4.2.post6}/cellpy/utils/batch.py +0 -0
  76. {cellpy-0.4.2.post4 → cellpy-0.4.2.post6}/cellpy/utils/batch_tools/__init__.py +0 -0
  77. {cellpy-0.4.2.post4 → cellpy-0.4.2.post6}/cellpy/utils/batch_tools/batch_analyzers.py +0 -0
  78. {cellpy-0.4.2.post4 → cellpy-0.4.2.post6}/cellpy/utils/batch_tools/batch_core.py +0 -0
  79. {cellpy-0.4.2.post4 → cellpy-0.4.2.post6}/cellpy/utils/batch_tools/batch_experiments.py +0 -0
  80. {cellpy-0.4.2.post4 → cellpy-0.4.2.post6}/cellpy/utils/batch_tools/batch_exporters.py +0 -0
  81. {cellpy-0.4.2.post4 → cellpy-0.4.2.post6}/cellpy/utils/batch_tools/batch_helpers.py +0 -0
  82. {cellpy-0.4.2.post4 → cellpy-0.4.2.post6}/cellpy/utils/batch_tools/batch_journals.py +0 -0
  83. {cellpy-0.4.2.post4 → cellpy-0.4.2.post6}/cellpy/utils/batch_tools/batch_plotters.py +0 -0
  84. {cellpy-0.4.2.post4 → cellpy-0.4.2.post6}/cellpy/utils/batch_tools/batch_reporters.py +0 -0
  85. {cellpy-0.4.2.post4 → cellpy-0.4.2.post6}/cellpy/utils/batch_tools/dumpers.py +0 -0
  86. {cellpy-0.4.2.post4 → cellpy-0.4.2.post6}/cellpy/utils/batch_tools/engines.py +0 -0
  87. {cellpy-0.4.2.post4 → cellpy-0.4.2.post6}/cellpy/utils/data/20160805_test001_45_cc.h5 +0 -0
  88. {cellpy-0.4.2.post4 → cellpy-0.4.2.post6}/cellpy/utils/data/raw/20160805_test001_45_cc_01.res +0 -0
  89. {cellpy-0.4.2.post4 → cellpy-0.4.2.post6}/cellpy/utils/diagnostics.py +0 -0
  90. {cellpy-0.4.2.post4 → cellpy-0.4.2.post6}/cellpy/utils/easyplot.py +0 -0
  91. {cellpy-0.4.2.post4 → cellpy-0.4.2.post6}/cellpy/utils/example_data.py +0 -0
  92. {cellpy-0.4.2.post4 → cellpy-0.4.2.post6}/cellpy/utils/helpers.py +0 -0
  93. {cellpy-0.4.2.post4 → cellpy-0.4.2.post6}/cellpy/utils/ica.py +0 -0
  94. {cellpy-0.4.2.post4 → cellpy-0.4.2.post6}/cellpy/utils/live.py +0 -0
  95. {cellpy-0.4.2.post4 → cellpy-0.4.2.post6}/cellpy/utils/ocv_rlx.py +0 -0
  96. {cellpy-0.4.2.post4 → cellpy-0.4.2.post6}/cellpy/utils/plotutils.py +0 -0
  97. {cellpy-0.4.2.post4 → cellpy-0.4.2.post6}/cellpy.egg-info/dependency_links.txt +0 -0
  98. {cellpy-0.4.2.post4 → cellpy-0.4.2.post6}/cellpy.egg-info/entry_points.txt +0 -0
  99. {cellpy-0.4.2.post4 → cellpy-0.4.2.post6}/cellpy.egg-info/not-zip-safe +0 -0
  100. {cellpy-0.4.2.post4 → cellpy-0.4.2.post6}/cellpy.egg-info/requires.txt +0 -0
  101. {cellpy-0.4.2.post4 → cellpy-0.4.2.post6}/cellpy.egg-info/top_level.txt +0 -0
  102. {cellpy-0.4.2.post4 → cellpy-0.4.2.post6}/docs/Makefile +0 -0
  103. /cellpy-0.4.2.post4/docs/_build/.doctrees/nbsphinx/notebooks_tutorial_get_cap_6_0.png → /cellpy-0.4.2.post6/docs/_build/.doctrees/nbsphinx/examples_and_tutorials_notebooks_tutorial_get_cap_6_0.png +0 -0
  104. /cellpy-0.4.2.post4/docs/_build/.doctrees/nbsphinx/notebooks_tutorial_get_cap_7_0.png → /cellpy-0.4.2.post6/docs/_build/.doctrees/nbsphinx/examples_and_tutorials_notebooks_tutorial_get_cap_7_0.png +0 -0
  105. /cellpy-0.4.2.post4/docs/_build/.doctrees/nbsphinx/notebooks_tutorial_get_cap_8_0.png → /cellpy-0.4.2.post6/docs/_build/.doctrees/nbsphinx/examples_and_tutorials_notebooks_tutorial_get_cap_8_0.png +0 -0
  106. /cellpy-0.4.2.post4/docs/_build/_images/notebooks_tutorial_get_cap_6_0.png → /cellpy-0.4.2.post6/docs/_build/_images/examples_and_tutorials_notebooks_tutorial_get_cap_6_0.png +0 -0
  107. /cellpy-0.4.2.post4/docs/_build/_images/notebooks_tutorial_get_cap_7_0.png → /cellpy-0.4.2.post6/docs/_build/_images/examples_and_tutorials_notebooks_tutorial_get_cap_7_0.png +0 -0
  108. /cellpy-0.4.2.post4/docs/_build/_images/notebooks_tutorial_get_cap_8_0.png → /cellpy-0.4.2.post6/docs/_build/_images/examples_and_tutorials_notebooks_tutorial_get_cap_8_0.png +0 -0
  109. {cellpy-0.4.2.post4 → cellpy-0.4.2.post6}/docs/_build/_images/templates_jupyterlab_001.png +0 -0
  110. {cellpy-0.4.2.post4 → cellpy-0.4.2.post6}/docs/_build/_images/tutorials_utils_plotting_fig1.png +0 -0
  111. {cellpy-0.4.2.post4 → cellpy-0.4.2.post6}/docs/_build/_images/tutorials_utils_plotting_fig2.png +0 -0
  112. {cellpy-0.4.2.post4 → cellpy-0.4.2.post6}/docs/_build/_static/file.png +0 -0
  113. {cellpy-0.4.2.post4 → cellpy-0.4.2.post6}/docs/_build/_static/minus.png +0 -0
  114. {cellpy-0.4.2.post4 → cellpy-0.4.2.post6}/docs/_build/_static/plus.png +0 -0
  115. {cellpy-0.4.2.post4 → cellpy-0.4.2.post6}/docs/authors.rst +0 -0
  116. {cellpy-0.4.2.post4 → cellpy-0.4.2.post6}/docs/basics.rst +0 -0
  117. {cellpy-0.4.2.post4 → cellpy-0.4.2.post6}/docs/contributing.rst +0 -0
  118. {cellpy-0.4.2.post4 → cellpy-0.4.2.post6}/docs/developers/dev_cellpy_data_structure.rst +0 -0
  119. {cellpy-0.4.2.post4 → cellpy-0.4.2.post6}/docs/developers/dev_cellpy_folder_structure.rst +0 -0
  120. {cellpy-0.4.2.post4 → cellpy-0.4.2.post6}/docs/developers/dev_various.rst +0 -0
  121. {cellpy-0.4.2.post4 → cellpy-0.4.2.post6}/docs/developers_guide.rst +0 -0
  122. {cellpy-0.4.2.post4 → cellpy-0.4.2.post6}/docs/examples.rst +0 -0
  123. {cellpy-0.4.2.post4 → cellpy-0.4.2.post6}/docs/formats.rst +0 -0
  124. {cellpy-0.4.2.post4 → cellpy-0.4.2.post6}/docs/history.rst +0 -0
  125. {cellpy-0.4.2.post4 → cellpy-0.4.2.post6}/docs/installation.rst +0 -0
  126. {cellpy-0.4.2.post4 → cellpy-0.4.2.post6}/docs/make.bat +0 -0
  127. {cellpy-0.4.2.post4 → cellpy-0.4.2.post6}/docs/notebooks.rst +0 -0
  128. {cellpy-0.4.2.post4 → cellpy-0.4.2.post6}/docs/source/cellpy.parameters.rst +0 -0
  129. {cellpy-0.4.2.post4 → cellpy-0.4.2.post6}/docs/source/cellpy.readers.instruments.rst +0 -0
  130. {cellpy-0.4.2.post4 → cellpy-0.4.2.post6}/docs/source/cellpy.readers.rst +0 -0
  131. {cellpy-0.4.2.post4 → cellpy-0.4.2.post6}/docs/source/cellpy.rst +0 -0
  132. {cellpy-0.4.2.post4 → cellpy-0.4.2.post6}/docs/source/cellpy.utils.batch_tools.rst +0 -0
  133. {cellpy-0.4.2.post4 → cellpy-0.4.2.post6}/docs/source/cellpy.utils.rst +0 -0
  134. {cellpy-0.4.2.post4 → cellpy-0.4.2.post6}/docs/source/modules.rst +0 -0
  135. {cellpy-0.4.2.post4 → cellpy-0.4.2.post6}/docs/tips_and_tricks.rst +0 -0
  136. {cellpy-0.4.2.post4 → cellpy-0.4.2.post6}/docs/tutorials/basic_interaction.rst +0 -0
  137. {cellpy-0.4.2.post4 → cellpy-0.4.2.post6}/docs/tutorials/configuring.rst +0 -0
  138. {cellpy-0.4.2.post4 → cellpy-0.4.2.post6}/docs/tutorials/data_mining.rst +0 -0
  139. {cellpy-0.4.2.post4 → cellpy-0.4.2.post6}/docs/tutorials/getting_started_tutorial.rst +0 -0
  140. {cellpy-0.4.2.post4 → cellpy-0.4.2.post6}/docs/tutorials/pandas.rst +0 -0
  141. {cellpy-0.4.2.post4 → cellpy-0.4.2.post6}/docs/tutorials/the_cellpy_cmd.rst +0 -0
  142. {cellpy-0.4.2.post4 → cellpy-0.4.2.post6}/docs/usage.rst +0 -0
  143. {cellpy-0.4.2.post4 → cellpy-0.4.2.post6}/docs/utils/batch.rst +0 -0
  144. {cellpy-0.4.2.post4 → cellpy-0.4.2.post6}/docs/utils/custom_file_loader.rst +0 -0
  145. {cellpy-0.4.2.post4 → cellpy-0.4.2.post6}/docs/utils/easyplot.rst +0 -0
  146. {cellpy-0.4.2.post4 → cellpy-0.4.2.post6}/docs/utils/figures/tutorials_utils_plotting_fig1.png +0 -0
  147. {cellpy-0.4.2.post4 → cellpy-0.4.2.post6}/docs/utils/figures/tutorials_utils_plotting_fig2.png +0 -0
  148. {cellpy-0.4.2.post4 → cellpy-0.4.2.post6}/docs/utils/ica.rst +0 -0
  149. {cellpy-0.4.2.post4 → cellpy-0.4.2.post6}/docs/utils/plotting.rst +0 -0
  150. {cellpy-0.4.2.post4 → cellpy-0.4.2.post6}/docs/utils/templates.rst +0 -0
  151. {cellpy-0.4.2.post4 → cellpy-0.4.2.post6}/docs/utils/tut_ocv_rlx.rst +0 -0
  152. {cellpy-0.4.2.post4 → cellpy-0.4.2.post6}/docs/utils.rst +0 -0
  153. {cellpy-0.4.2.post4 → cellpy-0.4.2.post6}/pyproject.toml +0 -0
  154. {cellpy-0.4.2.post4 → cellpy-0.4.2.post6}/setup.cfg +0 -0
  155. {cellpy-0.4.2.post4 → cellpy-0.4.2.post6}/setup.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: cellpy
3
- Version: 0.4.2.post4
3
+ Version: 0.4.2.post6
4
4
  Summary: Extract and manipulate data from battery cell testers.
5
5
  Home-page: https://github.com/jepegit/cellpy
6
6
  Author: Jan Petter Maehlen
@@ -0,0 +1 @@
1
+ __version__ = "0.4.2post6"
@@ -1,141 +1,141 @@
1
- """Set up logger instance"""
2
-
3
- import datetime
4
- import json
5
- import logging
6
- import logging.config
7
- import os
8
- import pathlib
9
- import shutil
10
- import tempfile
11
- import warnings
12
-
13
- from cellpy import prms
14
-
15
- logging.raiseExceptions = False
16
-
17
-
18
- def setup_logging(
19
- default_json_path=None,
20
- default_level=None,
21
- env_key="LOG_CFG",
22
- custom_log_dir=None,
23
- reset_big_log=False,
24
- max_size=5_000_000,
25
- testing=False,
26
- ):
27
- """Setup logging configuration.
28
-
29
- Args:
30
- default_level: default log-level to screen (std.out).
31
- default_json_path: path to config file for setting up logging.
32
- env_key (str): use this environment prm to try to get default_json_path.
33
- custom_log_dir: path for saving logs.
34
- reset_big_log (bool): reset log if too big (max_size).
35
- max_size (int): if reset_log, this is the max limit.
36
- testing (bool): set as True if testing, and you don't want to create any .log files
37
-
38
- """
39
-
40
- if not default_json_path:
41
- default_json_path = os.path.join(
42
- os.path.dirname(os.path.realpath(__file__)), "logging.json"
43
- )
44
- path = default_json_path
45
- value = os.getenv(env_key, None)
46
- if value:
47
- path = value
48
-
49
- if default_level is None:
50
- default_level = "CRITICAL"
51
-
52
- # loading logging configs
53
- if os.path.exists(path):
54
- with open(path, "rt") as f:
55
- config = json.load(f)
56
-
57
- if testing:
58
- log_dir = tempfile.mkdtemp()
59
- elif custom_log_dir:
60
- log_dir = custom_log_dir
61
- else:
62
- log_dir = os.path.abspath(prms.Paths.filelogdir)
63
-
64
- if not os.path.isdir(log_dir):
65
- warning_txt = (
66
- "\nCould not set custom log-dir - "
67
- "non-existing directory"
68
- f"\nDir: {log_dir}"
69
- "\nUsing current directory instead: "
70
- f"{os.getcwd()}"
71
- )
72
- logging.warning(warning_txt)
73
- log_dir = os.getcwd()
74
-
75
- for file_handler in [
76
- "error_file_handler",
77
- "info_file_handler",
78
- "debug_file_handler",
79
- ]:
80
- try:
81
- file_name = config["handlers"][file_handler]["filename"]
82
- logging.debug("Setting file handlers for logging.")
83
- logging.debug(f"Filename: {file_name}")
84
- logging.debug(f"Full path: {os.path.join(log_dir,file_name)}")
85
- # print(f"Filename: {file_name}")
86
- # print(f"Full path: {os.path.join(log_dir,file_name)}")
87
- config["handlers"][file_handler]["filename"] = os.path.join(
88
- log_dir, file_name
89
- )
90
-
91
- if reset_big_log:
92
- full_log_file_path = pathlib.Path(log_dir) / file_name
93
- if full_log_file_path.is_file():
94
- file_size = full_log_file_path.lstat().st_size
95
- if file_size > max_size:
96
- d_str = datetime.datetime.now().strftime("%Y_%m_%d_%H_%M")
97
- new_file_name = "_".join([d_str, file_name])
98
- new_full_log_file_path = (
99
- pathlib.Path(log_dir) / new_file_name
100
- )
101
- shutil.copy(full_log_file_path, new_full_log_file_path)
102
- else:
103
- logging.debug(
104
- "Could not reset big log: could not find the file"
105
- )
106
-
107
- except Exception as e:
108
- warnings.warn("\nCould not set custom log-dir" + str(e))
109
-
110
- if default_level:
111
- w_txt = "\nCould not set custom default level for logger"
112
- if default_level not in [
113
- "INFO",
114
- "DEBUG",
115
- "CRITICAL",
116
- logging.INFO,
117
- logging.DEBUG,
118
- logging.CRITICAL,
119
- ]:
120
- _txt = "\nonly 'INFO', 'DEBUG' and 'CRITICAL' is supported"
121
- _txt += " as default_level"
122
- warnings.warn(w_txt + _txt)
123
-
124
- else:
125
- try:
126
- config["handlers"]["console"]["level"] = default_level
127
- if default_level in ["DEBUG", logging.DEBUG]:
128
- config["handlers"]["console"]["formatter"] = "stamped"
129
-
130
- except Exception as e:
131
- warnings.warn(w_txt + "\n" + str(e))
132
-
133
- logging.config.dictConfig(config)
134
- else:
135
- if not default_level:
136
- default_level = logging.CRITICAL
137
- logging.basicConfig(level=default_level)
138
-
139
-
140
- if __name__ == "__main__":
141
- setup_logging()
1
+ """Set up logger instance"""
2
+
3
+ import datetime
4
+ import json
5
+ import logging
6
+ import logging.config
7
+ import os
8
+ import pathlib
9
+ import shutil
10
+ import tempfile
11
+ import warnings
12
+
13
+ from cellpy import prms
14
+
15
+ logging.raiseExceptions = False
16
+
17
+
18
+ def setup_logging(
19
+ default_json_path=None,
20
+ default_level=None,
21
+ env_key="LOG_CFG",
22
+ custom_log_dir=None,
23
+ reset_big_log=False,
24
+ max_size=5_000_000,
25
+ testing=False,
26
+ ):
27
+ """Setup logging configuration.
28
+
29
+ Args:
30
+ default_level: default log-level to screen (std.out).
31
+ default_json_path: path to config file for setting up logging.
32
+ env_key (str): use this environment prm to try to get default_json_path.
33
+ custom_log_dir: path for saving logs.
34
+ reset_big_log (bool): reset log if too big (max_size).
35
+ max_size (int): if reset_log, this is the max limit.
36
+ testing (bool): set as True if testing, and you don't want to create any .log files
37
+
38
+ """
39
+
40
+ if not default_json_path:
41
+ default_json_path = os.path.join(
42
+ os.path.dirname(os.path.realpath(__file__)), "logging.json"
43
+ )
44
+ path = default_json_path
45
+ value = os.getenv(env_key, None)
46
+ if value:
47
+ path = value
48
+
49
+ if default_level is None:
50
+ default_level = "CRITICAL"
51
+
52
+ # loading logging configs
53
+ if os.path.exists(path):
54
+ with open(path, "rt") as f:
55
+ config = json.load(f)
56
+
57
+ if testing:
58
+ log_dir = tempfile.mkdtemp()
59
+ elif custom_log_dir:
60
+ log_dir = custom_log_dir
61
+ else:
62
+ log_dir = os.path.abspath(prms.Paths.filelogdir)
63
+
64
+ if not os.path.isdir(log_dir):
65
+ warning_txt = (
66
+ "\nCould not set custom log-dir - "
67
+ "non-existing directory"
68
+ f"\nDir: {log_dir}"
69
+ "\nUsing current directory instead: "
70
+ f"{os.getcwd()}"
71
+ )
72
+ logging.warning(warning_txt)
73
+ log_dir = os.getcwd()
74
+
75
+ for file_handler in [
76
+ "error_file_handler",
77
+ "info_file_handler",
78
+ "debug_file_handler",
79
+ ]:
80
+ try:
81
+ file_name = config["handlers"][file_handler]["filename"]
82
+ logging.debug("Setting file handlers for logging.")
83
+ logging.debug(f"Filename: {file_name}")
84
+ logging.debug(f"Full path: {os.path.join(log_dir,file_name)}")
85
+ # print(f"Filename: {file_name}")
86
+ # print(f"Full path: {os.path.join(log_dir,file_name)}")
87
+ config["handlers"][file_handler]["filename"] = os.path.join(
88
+ log_dir, file_name
89
+ )
90
+
91
+ if reset_big_log:
92
+ full_log_file_path = pathlib.Path(log_dir) / file_name
93
+ if full_log_file_path.is_file():
94
+ file_size = full_log_file_path.lstat().st_size
95
+ if file_size > max_size:
96
+ d_str = datetime.datetime.now().strftime("%Y_%m_%d_%H_%M")
97
+ new_file_name = "_".join([d_str, file_name])
98
+ new_full_log_file_path = (
99
+ pathlib.Path(log_dir) / new_file_name
100
+ )
101
+ shutil.copy(full_log_file_path, new_full_log_file_path)
102
+ else:
103
+ logging.debug(
104
+ "Could not reset big log: could not find the file"
105
+ )
106
+
107
+ except Exception as e:
108
+ warnings.warn("\nCould not set custom log-dir" + str(e))
109
+
110
+ if default_level:
111
+ w_txt = "\nCould not set custom default level for logger"
112
+ if default_level not in [
113
+ "INFO",
114
+ "DEBUG",
115
+ "CRITICAL",
116
+ logging.INFO,
117
+ logging.DEBUG,
118
+ logging.CRITICAL,
119
+ ]:
120
+ _txt = "\nonly 'INFO', 'DEBUG' and 'CRITICAL' is supported"
121
+ _txt += " as default_level"
122
+ warnings.warn(w_txt + _txt)
123
+
124
+ else:
125
+ try:
126
+ config["handlers"]["console"]["level"] = default_level
127
+ if default_level in ["DEBUG", logging.DEBUG]:
128
+ config["handlers"]["console"]["formatter"] = "stamped"
129
+
130
+ except Exception as e:
131
+ warnings.warn(w_txt + "\n" + str(e))
132
+
133
+ logging.config.dictConfig(config)
134
+ else:
135
+ if not default_level:
136
+ default_level = logging.CRITICAL
137
+ logging.basicConfig(level=default_level)
138
+
139
+
140
+ if __name__ == "__main__":
141
+ setup_logging()
@@ -550,7 +550,7 @@ class DataLoader(BaseLoader):
550
550
  # --------- read global-data ------------------------------------
551
551
  self.logger.debug("reading global data table")
552
552
  sql = "select * from %s" % table_name_global
553
- global_data_df = pd.read_sql_query(sql, conn)
553
+ global_data_df = pd.read_sql_query(sql=sa.text(sql), con=conn.connect())
554
554
  # col_names = list(global_data_df.columns.values)
555
555
  self.logger.debug("sql statement: %s" % sql)
556
556
 
@@ -595,7 +595,7 @@ class DataLoader(BaseLoader):
595
595
  sql_4 = "AND %s=%i " % (cycle_txt, cycle_number)
596
596
  sql = sql_1 + sql_2 + sql_3 + sql_4 + sql_5
597
597
  self.logger.debug("sql statement: %s" % sql)
598
- normal_df = pd.read_sql_query(sql, conn)
598
+ normal_df = pd.read_sql_query(sql=sa.text(sql), con=conn.connect())
599
599
  t2 = time.time()
600
600
  dt = t2 - t1
601
601
  self.logger.debug("time: %f" % dt)
@@ -659,7 +659,7 @@ class DataLoader(BaseLoader):
659
659
  # --------- read global-data ------------------------------------
660
660
  self.logger.debug("reading global data table")
661
661
  sql = "select * from %s" % table_name_global
662
- global_data_df = pd.read_sql_query(sql, conn)
662
+ global_data_df = pd.read_sql_query(sql=sa.text(sql), con=conn.connect())
663
663
  # col_names = list(global_data_df.columns.values)
664
664
  self.logger.debug("sql statement: %s" % sql)
665
665
 
@@ -701,7 +701,7 @@ class DataLoader(BaseLoader):
701
701
  sql_4 = "AND %s=%i " % (cycle_txt, cycle_number)
702
702
  sql = sql_1 + sql_2 + sql_3 + sql_4 + sql_5
703
703
  self.logger.debug("sql statement: %s" % sql)
704
- normal_df = pd.read_sql_query(sql, conn)
704
+ normal_df = pd.read_sql_query(sql=sa.text(sql), con=conn.connect())
705
705
  t2 = time.time()
706
706
  dt = t2 - t1
707
707
  self.logger.debug("time: %f" % dt)
@@ -761,7 +761,7 @@ class DataLoader(BaseLoader):
761
761
  if sql is None:
762
762
  sql = f"select * from {table_name}"
763
763
  self.logger.debug(f"sql statement: {sql}")
764
- df = pd.read_sql_query(sql, conn)
764
+ df = pd.read_sql_query(sql=sa.text(sql), con=conn.connect())
765
765
  return df
766
766
 
767
767
  def _make_name_from_frame(self, df, aux_index, data_type, dx_dt=False):
@@ -849,7 +849,7 @@ class DataLoader(BaseLoader):
849
849
  data.test_ID,
850
850
  self.arbin_headers_normal.data_point_txt,
851
851
  )
852
- summary_df = pd.read_sql_query(sql, conn)
852
+ summary_df = pd.read_sql_query(sql=sa.text(sql), con=conn.connect())
853
853
 
854
854
  if summary_df.empty and prms.Reader.use_cellpy_stat_file:
855
855
  txt = "\nCould not find any summary (stats-file)!"
@@ -1397,14 +1397,13 @@ class DataLoader(BaseLoader):
1397
1397
  if not prms.Instruments.Arbin.chunk_size:
1398
1398
  self.logger.debug("no chunk-size given")
1399
1399
  # memory here
1400
- normal_df = pd.read_sql_query(sql, conn)
1400
+ normal_df = pd.read_sql_query(sql=sa.text(sql), con=conn.connect())
1401
1401
  # memory here
1402
1402
  length_of_test = normal_df.shape[0]
1403
1403
  else:
1404
1404
  self.logger.debug(f"chunk-size: {prms.Instruments.Arbin.chunk_size}")
1405
1405
  self.logger.debug("creating a pd.read_sql_query generator")
1406
- normal_df_reader = pd.read_sql_query(
1407
- sql, conn, chunksize=prms.Instruments.Arbin.chunk_size
1406
+ normal_df_reader = pd.read_sql_query(sql=sa.text(sql), con=conn.connect(), chunksize=prms.Instruments.Arbin.chunk_size
1408
1407
  )
1409
1408
  normal_df = None
1410
1409
  chunk_number = 0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: cellpy
3
- Version: 0.4.2.post4
3
+ Version: 0.4.2.post6
4
4
  Summary: Extract and manipulate data from battery cell testers.
5
5
  Home-page: https://github.com/jepegit/cellpy
6
6
  Author: Jan Petter Maehlen
@@ -84,6 +84,7 @@ cellpy/utils/batch_tools/engines.py
84
84
  cellpy/utils/data/20160805_test001_45_cc.h5
85
85
  cellpy/utils/data/raw/20160805_test001_45_cc_01.res
86
86
  docs/Makefile
87
+ docs/adapted_readme.rst
87
88
  docs/authors.rst
88
89
  docs/basics.rst
89
90
  docs/conf.py
@@ -96,18 +97,25 @@ docs/index.rst
96
97
  docs/installation.rst
97
98
  docs/make.bat
98
99
  docs/notebooks.rst
99
- docs/readme.rst
100
100
  docs/tips_and_tricks.rst
101
101
  docs/usage.rst
102
102
  docs/utils.rst
103
- docs/_build/.doctrees/nbsphinx/notebooks_tutorial_get_cap_6_0.png
104
- docs/_build/.doctrees/nbsphinx/notebooks_tutorial_get_cap_7_0.png
105
- docs/_build/.doctrees/nbsphinx/notebooks_tutorial_get_cap_8_0.png
106
- docs/_build/.doctrees/nbsphinx/notebooks_tutorial_simple_plot_2_0.png
107
- docs/_build/_images/notebooks_tutorial_get_cap_6_0.png
108
- docs/_build/_images/notebooks_tutorial_get_cap_7_0.png
109
- docs/_build/_images/notebooks_tutorial_get_cap_8_0.png
110
- docs/_build/_images/notebooks_tutorial_simple_plot_2_0.png
103
+ docs/_build/.doctrees/nbsphinx/examples_and_tutorials_notebooks_tutorial_get_cap_6_0.png
104
+ docs/_build/.doctrees/nbsphinx/examples_and_tutorials_notebooks_tutorial_get_cap_7_0.png
105
+ docs/_build/.doctrees/nbsphinx/examples_and_tutorials_notebooks_tutorial_get_cap_8_0.png
106
+ docs/_build/.doctrees/nbsphinx/examples_and_tutorials_notebooks_tutorial_simple_plot_2_0.png
107
+ docs/_build/_images/examples_and_tutorials_notebooks_tutorial_get_cap_6_0.png
108
+ docs/_build/_images/examples_and_tutorials_notebooks_tutorial_get_cap_7_0.png
109
+ docs/_build/_images/examples_and_tutorials_notebooks_tutorial_get_cap_8_0.png
110
+ docs/_build/_images/examples_and_tutorials_notebooks_tutorial_simple_plot_2_0.png
111
+ docs/_build/_images/graphviz-22185705e237fa530df24e4af50cb25833165e25.png
112
+ docs/_build/_images/graphviz-246f2486cd940f2ea40a07f847c86c22b2607ca8.png
113
+ docs/_build/_images/graphviz-42e9bc826d476a3d361a7f410e989ed34dc1aa85.png
114
+ docs/_build/_images/graphviz-619216a42370fd49669c083549129b8470c8fae1.png
115
+ docs/_build/_images/graphviz-6deb64a460668e8ef9bf0ca653314119adeeae66.png
116
+ docs/_build/_images/graphviz-83b62e03ef369ff0a30f027892dba95b91ea8b6c.png
117
+ docs/_build/_images/graphviz-ce8a9fe2ba01194aed847e0248d749db4093aca1.png
118
+ docs/_build/_images/graphviz-e94a5352318e02fcc5ef1f813e02a526c39af791.png
111
119
  docs/_build/_images/templates_jupyterlab_001.png
112
120
  docs/_build/_images/tutorials_utils_plotting_fig1.png
113
121
  docs/_build/_images/tutorials_utils_plotting_fig2.png
@@ -0,0 +1,57 @@
1
+ ==================================
2
+ Welcome to cellpy's documentation!
3
+ ==================================
4
+
5
+ - *a library for assisting in analysing batteries and cells*
6
+
7
+
8
+ .. image:: https://img.shields.io/pypi/v/cellpy.svg
9
+ :target: https://pypi.python.org/pypi/cellpy
10
+
11
+ .. image:: https://img.shields.io/travis/jepegit/cellpy.svg
12
+ :target: https://travis-ci.org/jepegit/cellpy
13
+
14
+ .. image:: https://readthedocs.org/projects/cellpy/badge/?version=latest
15
+ :target: https://cellpy.readthedocs.io/en/latest/?badge=latest
16
+ :alt: Documentation Status
17
+
18
+ .. image:: https://pepy.tech/badge/cellpy
19
+ :target: https://pepy.tech/project/cellpy
20
+
21
+
22
+ This Python Package was developed to help the
23
+ researchers at IFE, Norway, in their cumbersome task of
24
+ interpreting and handling data from cycling tests of
25
+ batteries and cells.
26
+
27
+ |ProjectVersion|
28
+
29
+ Installation and dependencies
30
+ -----------------------------
31
+
32
+ The easiest way to install ``cellpy`` is to install with conda or pip.
33
+
34
+ With conda::
35
+
36
+ conda install -c conda-forge cellpy
37
+
38
+ Or if you prefer installing using pip::
39
+
40
+ python -m pip install cellpy
41
+
42
+ Have a look at the documentation for more detailed installation procedures, especially
43
+ with respect to "difficult" dependencies when installing with pip.
44
+
45
+ Licence
46
+ -------
47
+
48
+ ``cellpy`` is free software made available under the MIT License.
49
+
50
+ Features
51
+ --------
52
+
53
+ * Load test-data and store in a common format.
54
+ * Summarize and compare data.
55
+ * Filter out the steps of interest.
56
+ * Process and plot the data.
57
+ * And more...