CoolPlot 1.2.0__tar.gz → 1.3.0__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 (109) hide show
  1. {coolplot-1.2.0/src/CoolPlot.egg-info → coolplot-1.3.0}/PKG-INFO +4 -1
  2. {coolplot-1.2.0 → coolplot-1.3.0}/pyproject.toml +26 -0
  3. {coolplot-1.2.0 → coolplot-1.3.0/src/CoolPlot.egg-info}/PKG-INFO +4 -1
  4. {coolplot-1.2.0 → coolplot-1.3.0}/src/CoolPlot.egg-info/SOURCES.txt +2 -0
  5. {coolplot-1.2.0 → coolplot-1.3.0}/src/CoolPlot.egg-info/requires.txt +4 -0
  6. coolplot-1.3.0/src/coolplot/__init__.py +119 -0
  7. {coolplot-1.2.0 → coolplot-1.3.0}/src/coolplot/__version__.py +1 -1
  8. {coolplot-1.2.0 → coolplot-1.3.0}/src/coolplot/chart.py +189 -97
  9. {coolplot-1.2.0 → coolplot-1.3.0}/src/coolplot/compose/builder.py +39 -35
  10. {coolplot-1.2.0 → coolplot-1.3.0}/src/coolplot/compose/corners.py +6 -6
  11. {coolplot-1.2.0 → coolplot-1.3.0}/src/coolplot/compose/layout.py +15 -9
  12. {coolplot-1.2.0 → coolplot-1.3.0}/src/coolplot/compose/rails.py +6 -4
  13. {coolplot-1.2.0 → coolplot-1.3.0}/src/coolplot/core/cycle.py +2 -2
  14. {coolplot-1.2.0 → coolplot-1.3.0}/src/coolplot/core/diagram_type.py +14 -3
  15. {coolplot-1.2.0 → coolplot-1.3.0}/src/coolplot/core/errors.py +1 -1
  16. {coolplot-1.2.0 → coolplot-1.3.0}/src/coolplot/core/limits.py +7 -2
  17. {coolplot-1.2.0 → coolplot-1.3.0}/src/coolplot/core/numbers.py +2 -2
  18. {coolplot-1.2.0 → coolplot-1.3.0}/src/coolplot/core/state.py +1 -0
  19. {coolplot-1.2.0 → coolplot-1.3.0}/src/coolplot/core/units.py +44 -10
  20. {coolplot-1.2.0 → coolplot-1.3.0}/src/coolplot/corelib.py +37 -19
  21. {coolplot-1.2.0 → coolplot-1.3.0}/src/coolplot/diagram.py +22 -12
  22. {coolplot-1.2.0 → coolplot-1.3.0}/src/coolplot/engine/background.py +8 -8
  23. {coolplot-1.2.0 → coolplot-1.3.0}/src/coolplot/engine/engine.py +10 -9
  24. {coolplot-1.2.0 → coolplot-1.3.0}/src/coolplot/engine/planning.py +11 -10
  25. {coolplot-1.2.0 → coolplot-1.3.0}/src/coolplot/engine/store.py +5 -4
  26. {coolplot-1.2.0 → coolplot-1.3.0}/src/coolplot/export.py +8 -2
  27. {coolplot-1.2.0 → coolplot-1.3.0}/src/coolplot/interaction.py +1 -1
  28. {coolplot-1.2.0 → coolplot-1.3.0}/src/coolplot/psychrometric.py +22 -15
  29. coolplot-1.3.0/src/coolplot/py.typed +0 -0
  30. {coolplot-1.2.0 → coolplot-1.3.0}/src/coolplot/render/base.py +8 -8
  31. {coolplot-1.2.0 → coolplot-1.3.0}/src/coolplot/render/mpl.py +34 -27
  32. {coolplot-1.2.0 → coolplot-1.3.0}/src/coolplot/render/pdf.py +5 -2
  33. {coolplot-1.2.0 → coolplot-1.3.0}/src/coolplot/render/plotly.py +36 -31
  34. {coolplot-1.2.0 → coolplot-1.3.0}/src/coolplot/render/svg.py +32 -29
  35. {coolplot-1.2.0 → coolplot-1.3.0}/src/coolplot/render/web.py +1 -1
  36. {coolplot-1.2.0 → coolplot-1.3.0}/src/coolplot/scene.py +17 -11
  37. {coolplot-1.2.0 → coolplot-1.3.0}/src/coolplot/spec/diagram.py +23 -12
  38. {coolplot-1.2.0 → coolplot-1.3.0}/src/coolplot/spec/fluid.py +2 -2
  39. {coolplot-1.2.0 → coolplot-1.3.0}/src/coolplot/spec/settings.py +4 -4
  40. {coolplot-1.2.0 → coolplot-1.3.0}/src/coolplot/style/theme.py +2 -2
  41. {coolplot-1.2.0 → coolplot-1.3.0}/src/coolplot/style/values.py +7 -4
  42. {coolplot-1.2.0 → coolplot-1.3.0}/src/coolplot/testing/kit.py +30 -27
  43. {coolplot-1.2.0 → coolplot-1.3.0}/src/coolplot/testing/pdf_reader.py +16 -14
  44. {coolplot-1.2.0 → coolplot-1.3.0}/src/coolplot/thermo/cycles/models.py +19 -14
  45. {coolplot-1.2.0 → coolplot-1.3.0}/src/coolplot/thermo/cycles/paths.py +2 -2
  46. {coolplot-1.2.0 → coolplot-1.3.0}/src/coolplot/thermo/fluid.py +11 -10
  47. {coolplot-1.2.0 → coolplot-1.3.0}/src/coolplot/thermo/humid_air.py +3 -3
  48. {coolplot-1.2.0 → coolplot-1.3.0}/src/coolplot/thermo/isolines.py +8 -7
  49. {coolplot-1.2.0 → coolplot-1.3.0}/src/coolplot/thermo/native.py +4 -3
  50. {coolplot-1.2.0 → coolplot-1.3.0}/src/coolplot/thermo/provider.py +6 -3
  51. {coolplot-1.2.0 → coolplot-1.3.0}/src/coolplot/thermo/references.py +4 -3
  52. {coolplot-1.2.0 → coolplot-1.3.0}/src/coolplot/thermo/stepping.py +2 -2
  53. {coolplot-1.2.0 → coolplot-1.3.0}/src/coolplot/thermo/tracer.py +4 -2
  54. {coolplot-1.2.0 → coolplot-1.3.0}/tests/test_architecture.py +2 -0
  55. {coolplot-1.2.0 → coolplot-1.3.0}/tests/test_diagram.py +48 -1
  56. {coolplot-1.2.0 → coolplot-1.3.0}/tests/test_examples.py +64 -2
  57. {coolplot-1.2.0 → coolplot-1.3.0}/tests/test_layout.py +15 -0
  58. {coolplot-1.2.0 → coolplot-1.3.0}/tests/test_native_core.py +37 -0
  59. coolplot-1.3.0/tests/test_typing.py +81 -0
  60. coolplot-1.2.0/src/coolplot/__init__.py +0 -86
  61. {coolplot-1.2.0 → coolplot-1.3.0}/LICENSE +0 -0
  62. {coolplot-1.2.0 → coolplot-1.3.0}/README.md +0 -0
  63. {coolplot-1.2.0 → coolplot-1.3.0}/setup.cfg +0 -0
  64. {coolplot-1.2.0 → coolplot-1.3.0}/src/CoolPlot.egg-info/dependency_links.txt +0 -0
  65. {coolplot-1.2.0 → coolplot-1.3.0}/src/CoolPlot.egg-info/top_level.txt +0 -0
  66. {coolplot-1.2.0 → coolplot-1.3.0}/src/coolplot/compose/__init__.py +0 -0
  67. {coolplot-1.2.0 → coolplot-1.3.0}/src/coolplot/compose/branding.py +0 -0
  68. {coolplot-1.2.0 → coolplot-1.3.0}/src/coolplot/core/__init__.py +0 -0
  69. {coolplot-1.2.0 → coolplot-1.3.0}/src/coolplot/core/events.py +0 -0
  70. {coolplot-1.2.0 → coolplot-1.3.0}/src/coolplot/core/floats.py +0 -0
  71. {coolplot-1.2.0 → coolplot-1.3.0}/src/coolplot/core/images.py +0 -0
  72. {coolplot-1.2.0 → coolplot-1.3.0}/src/coolplot/core/implementation.py +0 -0
  73. {coolplot-1.2.0 → coolplot-1.3.0}/src/coolplot/core/quantities.py +0 -0
  74. {coolplot-1.2.0 → coolplot-1.3.0}/src/coolplot/core/textwidth.py +0 -0
  75. {coolplot-1.2.0 → coolplot-1.3.0}/src/coolplot/engine/__init__.py +0 -0
  76. {coolplot-1.2.0 → coolplot-1.3.0}/src/coolplot/engine/cache.py +0 -0
  77. {coolplot-1.2.0 → coolplot-1.3.0}/src/coolplot/render/__init__.py +0 -0
  78. {coolplot-1.2.0 → coolplot-1.3.0}/src/coolplot/render/static/scene_svg.js +0 -0
  79. {coolplot-1.2.0 → coolplot-1.3.0}/src/coolplot/render/ticks.py +0 -0
  80. {coolplot-1.2.0 → coolplot-1.3.0}/src/coolplot/spec/__init__.py +0 -0
  81. {coolplot-1.2.0 → coolplot-1.3.0}/src/coolplot/style/__init__.py +0 -0
  82. {coolplot-1.2.0 → coolplot-1.3.0}/src/coolplot/testing/__init__.py +0 -0
  83. {coolplot-1.2.0 → coolplot-1.3.0}/src/coolplot/thermo/__init__.py +0 -0
  84. {coolplot-1.2.0 → coolplot-1.3.0}/src/coolplot/thermo/cycles/__init__.py +0 -0
  85. {coolplot-1.2.0 → coolplot-1.3.0}/src/coolplot/thermo/limits.py +0 -0
  86. {coolplot-1.2.0 → coolplot-1.3.0}/src/coolplot/thermo/process.py +0 -0
  87. {coolplot-1.2.0 → coolplot-1.3.0}/tests/test_api_vocabulary.py +0 -0
  88. {coolplot-1.2.0 → coolplot-1.3.0}/tests/test_backend_conformance.py +0 -0
  89. {coolplot-1.2.0 → coolplot-1.3.0}/tests/test_background.py +0 -0
  90. {coolplot-1.2.0 → coolplot-1.3.0}/tests/test_branding.py +0 -0
  91. {coolplot-1.2.0 → coolplot-1.3.0}/tests/test_contracts.py +0 -0
  92. {coolplot-1.2.0 → coolplot-1.3.0}/tests/test_curve_store.py +0 -0
  93. {coolplot-1.2.0 → coolplot-1.3.0}/tests/test_cycles.py +0 -0
  94. {coolplot-1.2.0 → coolplot-1.3.0}/tests/test_engine.py +0 -0
  95. {coolplot-1.2.0 → coolplot-1.3.0}/tests/test_events.py +0 -0
  96. {coolplot-1.2.0 → coolplot-1.3.0}/tests/test_native.py +0 -0
  97. {coolplot-1.2.0 → coolplot-1.3.0}/tests/test_numerics.py +0 -0
  98. {coolplot-1.2.0 → coolplot-1.3.0}/tests/test_pdf.py +0 -0
  99. {coolplot-1.2.0 → coolplot-1.3.0}/tests/test_plotly.py +0 -0
  100. {coolplot-1.2.0 → coolplot-1.3.0}/tests/test_psychro.py +0 -0
  101. {coolplot-1.2.0 → coolplot-1.3.0}/tests/test_rails.py +0 -0
  102. {coolplot-1.2.0 → coolplot-1.3.0}/tests/test_saturation_anchors.py +0 -0
  103. {coolplot-1.2.0 → coolplot-1.3.0}/tests/test_scene_js.py +0 -0
  104. {coolplot-1.2.0 → coolplot-1.3.0}/tests/test_scene_render.py +0 -0
  105. {coolplot-1.2.0 → coolplot-1.3.0}/tests/test_spec.py +0 -0
  106. {coolplot-1.2.0 → coolplot-1.3.0}/tests/test_style.py +0 -0
  107. {coolplot-1.2.0 → coolplot-1.3.0}/tests/test_thermo.py +0 -0
  108. {coolplot-1.2.0 → coolplot-1.3.0}/tests/test_web.py +0 -0
  109. {coolplot-1.2.0 → coolplot-1.3.0}/tests/test_web_server.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: CoolPlot
3
- Version: 1.2.0
3
+ Version: 1.3.0
4
4
  Summary: Thermodynamic property diagrams with CoolProp as data source.
5
5
  Author-email: Jorrit Wronski <coolplot@jorrit.org>
6
6
  License: MIT License
@@ -42,6 +42,9 @@ Provides-Extra: test
42
42
  Requires-Dist: pytest>=7; extra == "test"
43
43
  Requires-Dist: matplotlib>=3.8; extra == "test"
44
44
  Requires-Dist: plotly>=5.22; extra == "test"
45
+ Provides-Extra: typing
46
+ Requires-Dist: mypy>=2.4; extra == "typing"
47
+ Requires-Dist: matplotlib>=3.8; extra == "typing"
45
48
  Dynamic: license-file
46
49
 
47
50
 
@@ -36,6 +36,8 @@ plotly = ["plotly>=5.22"]
36
36
  # PDF and images from the plotly backend; kaleido also needs Chrome
37
37
  images = ["plotly>=5.22", "kaleido>=1.0"]
38
38
  test = ["pytest>=7", "matplotlib>=3.8", "plotly>=5.22"]
39
+ # Type checking: tests/test_typing.py runs mypy (skipped without it)
40
+ typing = ["mypy>=2.4", "matplotlib>=3.8"]
39
41
 
40
42
  [project.urls]
41
43
  Homepage = "https://github.com/CoolProp/CoolPlot"
@@ -47,8 +49,32 @@ version = {attr = "coolplot.__version__.__version__"}
47
49
  where = ["src"]
48
50
 
49
51
  [tool.setuptools.package-data]
52
+ "coolplot" = ["py.typed"] # the package ships its type annotations (PEP 561)
50
53
  "coolplot.render" = ["static/*.js"]
51
54
 
55
+ [tool.mypy]
56
+ # The package ships its annotations (src/coolplot/py.typed); tests/test_typing.py
57
+ # runs mypy with this configuration over the package and over the typing checks
58
+ # in tests/typing. Unannotated functions are checked too.
59
+ files = ["src/coolplot"]
60
+ python_version = "3.11"
61
+ check_untyped_defs = true
62
+ warn_unused_ignores = true
63
+ warn_redundant_casts = true
64
+ strict_equality = true
65
+
66
+ # The modules applications work with are fully annotated, and stay so. More
67
+ # modules join this list during 1.x (docs/contributing/typing.md).
68
+ [[tool.mypy.overrides]]
69
+ module = ["coolplot", "coolplot.chart", "coolplot.diagram", "coolplot.psychrometric", "coolplot.export"]
70
+ disallow_untyped_defs = true
71
+ disallow_incomplete_defs = true
72
+
73
+ # Imported only when installed; none of them ships type information
74
+ [[tool.mypy.overrides]]
75
+ module = ["plotly", "plotly.*", "choreographer.*", "kaleido", "kaleido.*", "coolplot_core"]
76
+ ignore_missing_imports = true
77
+
52
78
  [tool.pytest.ini_options]
53
79
  testpaths = ["tests"]
54
80
  markers = [
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: CoolPlot
3
- Version: 1.2.0
3
+ Version: 1.3.0
4
4
  Summary: Thermodynamic property diagrams with CoolProp as data source.
5
5
  Author-email: Jorrit Wronski <coolplot@jorrit.org>
6
6
  License: MIT License
@@ -42,6 +42,9 @@ Provides-Extra: test
42
42
  Requires-Dist: pytest>=7; extra == "test"
43
43
  Requires-Dist: matplotlib>=3.8; extra == "test"
44
44
  Requires-Dist: plotly>=5.22; extra == "test"
45
+ Provides-Extra: typing
46
+ Requires-Dist: mypy>=2.4; extra == "typing"
47
+ Requires-Dist: matplotlib>=3.8; extra == "typing"
45
48
  Dynamic: license-file
46
49
 
47
50
 
@@ -14,6 +14,7 @@ src/coolplot/diagram.py
14
14
  src/coolplot/export.py
15
15
  src/coolplot/interaction.py
16
16
  src/coolplot/psychrometric.py
17
+ src/coolplot/py.typed
17
18
  src/coolplot/scene.py
18
19
  src/coolplot/compose/__init__.py
19
20
  src/coolplot/compose/branding.py
@@ -100,5 +101,6 @@ tests/test_scene_render.py
100
101
  tests/test_spec.py
101
102
  tests/test_style.py
102
103
  tests/test_thermo.py
104
+ tests/test_typing.py
103
105
  tests/test_web.py
104
106
  tests/test_web_server.py
@@ -15,3 +15,7 @@ plotly>=5.22
15
15
  pytest>=7
16
16
  matplotlib>=3.8
17
17
  plotly>=5.22
18
+
19
+ [typing]
20
+ mypy>=2.4
21
+ matplotlib>=3.8
@@ -0,0 +1,119 @@
1
+ # -*- coding: utf-8 -*-
2
+ """CoolPlot: thermodynamic property diagrams with CoolProp as data source.
3
+
4
+ The package is organised in layers; each may only use the layers listed
5
+ before it (see docs/contributing/architecture.md, section 4):
6
+
7
+ * ``core``: quantities and units, plain data.
8
+ * ``style``: style values and themes.
9
+ * ``scene``: the backend-neutral description of a plot.
10
+ * ``spec``: what the user asks for (fluid, diagram, settings) as data.
11
+ * ``thermo``: all property calculations, in SI units; the only layer that
12
+ imports CoolProp.
13
+ * ``engine``: which curves are needed, computing and caching them.
14
+ * ``compose``: computed curves plus spec and settings become a scene.
15
+ * ``render``: backends that draw a scene; ``render.mpl`` is the only module
16
+ that imports matplotlib.
17
+ * ``chart``: :class:`Chart`, the facade users work with;
18
+ :class:`PropertyDiagram` and :class:`PsychrometricChart` are its two
19
+ constructors.
20
+
21
+ See docs/how_to/themes.md for themes and docs/contributing/writing_a_backend.md for writing a new
22
+ backend.
23
+ """
24
+ from typing import TYPE_CHECKING, Any
25
+
26
+ from .__version__ import __version__ # noqa: F401
27
+
28
+ if TYPE_CHECKING:
29
+ # The same names as in _LAZY below, imported for type checkers only, so
30
+ # that they see the real classes and functions behind the lazy loading
31
+ # (tests/test_typing.py checks that the two lists agree). "X as X" marks
32
+ # a name as part of the package's API for checkers in strict mode.
33
+ from .chart import Chart as Chart
34
+ from .core.cycle import Cycle as Cycle, StateInput as StateInput
35
+ from .core.diagram_type import DiagramType as DiagramType
36
+ from .core.errors import PropertyError as PropertyError
37
+ from .core.implementation import native_mode as native_mode, set_native_mode as set_native_mode
38
+ from .core.limits import Region as Region, Relative as Relative, TpLimits as TpLimits
39
+ from .core.state import StatePoint as StatePoint
40
+ from .core.units import (ENGINEERING as ENGINEERING, IP as IP, KSI as KSI, SI as SI, Unit as Unit,
41
+ UnitSystem as UnitSystem)
42
+ from .diagram import PropertyDiagram as PropertyDiagram
43
+ from .engine import Engine as Engine
44
+ from .export import save_pdf as save_pdf
45
+ from .psychrometric import PsychrometricChart as PsychrometricChart
46
+ from .scene import Scene as Scene
47
+ from .spec import (BrandingSettings as BrandingSettings, CalcSettings as CalcSettings, CycleSpec as CycleSpec,
48
+ DiagramSpec as DiagramSpec, FluidSpec as FluidSpec, HumidAirSpec as HumidAirSpec,
49
+ IsolineSet as IsolineSet, LabelSettings as LabelSettings, PageSettings as PageSettings,
50
+ ProcessSpec as ProcessSpec, Settings as Settings)
51
+ from .style.theme import Theme as Theme, get_theme as get_theme
52
+ from .style.values import (AxesStyle as AxesStyle, Font as Font, LegendStyle as LegendStyle,
53
+ LineStyle as LineStyle, MarkerStyle as MarkerStyle, TextStyle as TextStyle)
54
+ from .thermo import Fluid as Fluid, process_path as process_path, state_point as state_point
55
+
56
+ # The names below are loaded on first access (PEP 562). Importing a light
57
+ # module such as coolplot.scene therefore does not pull in CoolProp.
58
+ _LAZY = {
59
+ "Chart": ".chart",
60
+ "PropertyDiagram": ".diagram",
61
+ "PsychrometricChart": ".psychrometric",
62
+ "HumidAirSpec": ".spec",
63
+ "save_pdf": ".export",
64
+ "Cycle": ".core.cycle",
65
+ "CycleSpec": ".spec",
66
+ "StateInput": ".core.cycle",
67
+ "DiagramSpec": ".spec",
68
+ "FluidSpec": ".spec",
69
+ "IsolineSet": ".spec",
70
+ "ProcessSpec": ".spec",
71
+ "Settings": ".spec",
72
+ "CalcSettings": ".spec",
73
+ "LabelSettings": ".spec",
74
+ "PageSettings": ".spec",
75
+ "BrandingSettings": ".spec",
76
+ "Engine": ".engine",
77
+ "Fluid": ".thermo",
78
+ "DiagramType": ".core.diagram_type",
79
+ "TpLimits": ".core.limits",
80
+ "Relative": ".core.limits",
81
+ "Region": ".core.limits",
82
+ "StatePoint": ".core.state",
83
+ "state_point": ".thermo",
84
+ "process_path": ".thermo",
85
+ "Theme": ".style.theme",
86
+ "get_theme": ".style.theme",
87
+ "LineStyle": ".style.values",
88
+ "MarkerStyle": ".style.values",
89
+ "TextStyle": ".style.values",
90
+ "Font": ".style.values",
91
+ "AxesStyle": ".style.values",
92
+ "LegendStyle": ".style.values",
93
+ "Scene": ".scene",
94
+ "UnitSystem": ".core.units",
95
+ "Unit": ".core.units",
96
+ "SI": ".core.units",
97
+ "KSI": ".core.units",
98
+ "ENGINEERING": ".core.units",
99
+ "IP": ".core.units",
100
+ "PropertyError": ".core.errors",
101
+ "native_mode": ".core.implementation",
102
+ "set_native_mode": ".core.implementation",
103
+ }
104
+
105
+ __all__ = ["__version__"] + sorted(_LAZY)
106
+
107
+
108
+ if not TYPE_CHECKING:
109
+ # Hidden from type checkers: for them a module with __getattr__ has every
110
+ # name, and a misspelt one would pass unnoticed. They read the imports above.
111
+ def __getattr__(name: str) -> Any:
112
+ if name == "EUR": # the old name of ENGINEERING, warns until 2.0 (see core.units)
113
+ from .core.units import _old_eur
114
+ return _old_eur(2)
115
+ if name in _LAZY:
116
+ import importlib
117
+ module = importlib.import_module(_LAZY[name], __name__)
118
+ return getattr(module, name)
119
+ raise AttributeError("module 'coolplot' has no attribute '{0}'".format(name))
@@ -1,4 +1,4 @@
1
1
  # CoolPlot version information
2
- VERSION = (1, 2, 0, '')
2
+ VERSION = (1, 3, 0, '')
3
3
 
4
4
  __version__ = '.'.join(map(str, VERSION[:3])) + ''.join(VERSION[3:])