gypt_matplotlib 0.2.2__tar.gz → 0.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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: gypt_matplotlib
3
- Version: 0.2.2
3
+ Version: 0.3.0
4
4
  Summary: A small addon for matplotlib that can be used for the GYPT.
5
5
  License: MIT
6
6
  Keywords: Albert Unruh,GYPT,German Young Physicists' Tournament,matplotlib,addon
@@ -30,19 +30,20 @@ Project-URL: soucecode, https://github.com/AlbertUnruh/gypt-matplotlib
30
30
  Description-Content-Type: text/markdown
31
31
 
32
32
  [![GitHub License](https://img.shields.io/github/license/AlbertUnruh/gypt-matplotlib)](https://github.com/AlbertUnruh/gypt-matplotlib/blob/develop/LICENSE)
33
- [![Python version](https://img.shields.io/badge/dynamic/toml?url=https%3A%2F%2Fraw.githubusercontent.com%2FAlbertUnruh%2Fgypt-matplotlib%2Frefs%2Fheads%2Fdevelop%2Fpyproject.toml&query=%24.project.requires-python&label=Python)](https://python.org)
34
- [![PyPI - Version](https://img.shields.io/pypi/v/gypt_matplotlib?label=PyPi)](https://pypi.org/project/gypt_matplotlib/)
35
- [![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
33
+ [![Python Version](https://img.shields.io/pypi/pyversions/gypt_matplotlib.svg?style=flat&label=Python&logo=Python)](https://python.org)
34
+ [![PyPI Version](https://img.shields.io/pypi/v/gypt_matplotlib?label=PyPi)](https://pypi.org/project/gypt_matplotlib/)
35
+ [![Downloads](https://static.pepy.tech/personalized-badge/gypt_matplotlib?period=total&units=international_system&left_color=grey&right_color=brightgreen&left_text=Downloads)](https://pepy.tech/project/gypt_matplotlib)
36
+ [![Code Style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
36
37
  </br>
37
- [![pre-commit.ci status](https://results.pre-commit.ci/badge/github/AlbertUnruh/gypt-matplotlib/develop.svg)](https://results.pre-commit.ci/latest/github/AlbertUnruh/gypt-matplotlib/develop)
38
+ [![pre-commit.ci Status](https://results.pre-commit.ci/badge/github/AlbertUnruh/gypt-matplotlib/develop.svg)](https://results.pre-commit.ci/latest/github/AlbertUnruh/gypt-matplotlib/develop)
38
39
  [![Code QL](https://img.shields.io/github/actions/workflow/status/AlbertUnruh/gypt-matplotlib/.github%2Fworkflows%2Fcodeql.yml?branch=develop&logo=github&label=CodeQL)](https://github.com/AlbertUnruh/gypt-matplotlib/actions/workflows/codeql.yml)
39
- [![pytest](https://img.shields.io/github/actions/workflow/status/AlbertUnruh/gypt-matplotlib/.github%2Fworkflows%2Fpytest.yml?branch=develop&logo=github&label=pytest)](https://github.com/AlbertUnruh/gypt-matplotlib/actions/workflows/pytest.yml)
40
+ [![PyTest](https://img.shields.io/github/actions/workflow/status/AlbertUnruh/gypt-matplotlib/.github%2Fworkflows%2Fpytest.yml?branch=develop&logo=github&label=pytest)](https://github.com/AlbertUnruh/gypt-matplotlib/actions/workflows/pytest.yml)
40
41
  </br>
41
42
  [![GitHub Issues](https://img.shields.io/github/issues-raw/AlbertUnruh/gypt-matplotlib)](https://github.com/AlbertUnruh/gypt-matplotlib/issues)
42
43
  [![GitHub PRs](https://img.shields.io/github/issues-pr-raw/AlbertUnruh/gypt-matplotlib)](https://github.com/AlbertUnruh/gypt-matplotlib/pulls)
43
44
 
44
45
 
45
- # gypt-matplotlib
46
+ # gypt_matplotlib
46
47
  A small addon for matplotlib that can be used for the GYPT.
47
48
 
48
49
 
@@ -54,6 +55,17 @@ GYPT stands for **G**erman **Y**oung **P**hysicists’ **T**ournament.
54
55
  Further information can be found at [gypt.org][].
55
56
 
56
57
 
58
+ ### I'm a participant of the GYPT. Can I contribute?
59
+ Of course, you can.
60
+ Even if you are just a former participant, you are welcome.
61
+ In fact, everyone is welcome to contribute or ask for features!
62
+
63
+ Simply open an [issue][] and say what you would like to do so that details can be clarified directly.
64
+
65
+
66
+ [issue]: https://github.com/AlbertUnruh/gypt-matplotlib/issues
67
+
68
+
57
69
  ### Where did you get the stylesheet?
58
70
  It's available over [here][stylesheet] at the [GYPT wiki][wiki].
59
71
 
@@ -1,17 +1,18 @@
1
1
  [![GitHub License](https://img.shields.io/github/license/AlbertUnruh/gypt-matplotlib)](https://github.com/AlbertUnruh/gypt-matplotlib/blob/develop/LICENSE)
2
- [![Python version](https://img.shields.io/badge/dynamic/toml?url=https%3A%2F%2Fraw.githubusercontent.com%2FAlbertUnruh%2Fgypt-matplotlib%2Frefs%2Fheads%2Fdevelop%2Fpyproject.toml&query=%24.project.requires-python&label=Python)](https://python.org)
3
- [![PyPI - Version](https://img.shields.io/pypi/v/gypt_matplotlib?label=PyPi)](https://pypi.org/project/gypt_matplotlib/)
4
- [![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
2
+ [![Python Version](https://img.shields.io/pypi/pyversions/gypt_matplotlib.svg?style=flat&label=Python&logo=Python)](https://python.org)
3
+ [![PyPI Version](https://img.shields.io/pypi/v/gypt_matplotlib?label=PyPi)](https://pypi.org/project/gypt_matplotlib/)
4
+ [![Downloads](https://static.pepy.tech/personalized-badge/gypt_matplotlib?period=total&units=international_system&left_color=grey&right_color=brightgreen&left_text=Downloads)](https://pepy.tech/project/gypt_matplotlib)
5
+ [![Code Style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
5
6
  </br>
6
- [![pre-commit.ci status](https://results.pre-commit.ci/badge/github/AlbertUnruh/gypt-matplotlib/develop.svg)](https://results.pre-commit.ci/latest/github/AlbertUnruh/gypt-matplotlib/develop)
7
+ [![pre-commit.ci Status](https://results.pre-commit.ci/badge/github/AlbertUnruh/gypt-matplotlib/develop.svg)](https://results.pre-commit.ci/latest/github/AlbertUnruh/gypt-matplotlib/develop)
7
8
  [![Code QL](https://img.shields.io/github/actions/workflow/status/AlbertUnruh/gypt-matplotlib/.github%2Fworkflows%2Fcodeql.yml?branch=develop&logo=github&label=CodeQL)](https://github.com/AlbertUnruh/gypt-matplotlib/actions/workflows/codeql.yml)
8
- [![pytest](https://img.shields.io/github/actions/workflow/status/AlbertUnruh/gypt-matplotlib/.github%2Fworkflows%2Fpytest.yml?branch=develop&logo=github&label=pytest)](https://github.com/AlbertUnruh/gypt-matplotlib/actions/workflows/pytest.yml)
9
+ [![PyTest](https://img.shields.io/github/actions/workflow/status/AlbertUnruh/gypt-matplotlib/.github%2Fworkflows%2Fpytest.yml?branch=develop&logo=github&label=pytest)](https://github.com/AlbertUnruh/gypt-matplotlib/actions/workflows/pytest.yml)
9
10
  </br>
10
11
  [![GitHub Issues](https://img.shields.io/github/issues-raw/AlbertUnruh/gypt-matplotlib)](https://github.com/AlbertUnruh/gypt-matplotlib/issues)
11
12
  [![GitHub PRs](https://img.shields.io/github/issues-pr-raw/AlbertUnruh/gypt-matplotlib)](https://github.com/AlbertUnruh/gypt-matplotlib/pulls)
12
13
 
13
14
 
14
- # gypt-matplotlib
15
+ # gypt_matplotlib
15
16
  A small addon for matplotlib that can be used for the GYPT.
16
17
 
17
18
 
@@ -23,6 +24,17 @@ GYPT stands for **G**erman **Y**oung **P**hysicists’ **T**ournament.
23
24
  Further information can be found at [gypt.org][].
24
25
 
25
26
 
27
+ ### I'm a participant of the GYPT. Can I contribute?
28
+ Of course, you can.
29
+ Even if you are just a former participant, you are welcome.
30
+ In fact, everyone is welcome to contribute or ask for features!
31
+
32
+ Simply open an [issue][] and say what you would like to do so that details can be clarified directly.
33
+
34
+
35
+ [issue]: https://github.com/AlbertUnruh/gypt-matplotlib/issues
36
+
37
+
26
38
  ### Where did you get the stylesheet?
27
39
  It's available over [here][stylesheet] at the [GYPT wiki][wiki].
28
40
 
@@ -1,4 +1,4 @@
1
- __version__ = "0.2.2"
1
+ __version__ = "0.3.0"
2
2
  __description__ = "A small addon for matplotlib that can be used for the GYPT."
3
3
  __license__ = "MIT"
4
4
  __authors__ = ["Keenan Noack <AlbertUnruh@pm.me>"]
@@ -6,6 +6,7 @@ __repository__ = "https://github.com/AlbertUnruh/gypt-matplotlib/"
6
6
 
7
7
 
8
8
  # local
9
+ from . import constants, context_managers, utils
9
10
  from .context_managers import au_plot, auto_close, auto_save, auto_save_and_show, auto_show
10
11
  from .utils import apply_gypt_style, axes_label, tex
11
12
 
@@ -17,7 +18,10 @@ __all__ = (
17
18
  "auto_save_and_show",
18
19
  "auto_show",
19
20
  "axes_label",
21
+ "constants",
22
+ "context_managers",
20
23
  "tex",
24
+ "utils",
21
25
  )
22
26
 
23
27
 
@@ -47,6 +47,10 @@ def auto_save(fname: Path | str, **kwargs: ...):
47
47
  **kwargs
48
48
  Will be passed to `plt.savefig()`.
49
49
 
50
+ Notes
51
+ -----
52
+ This contextmanager automatically applies `plt.tight_layout()` to the plot.
53
+
50
54
  Warnings
51
55
  --------
52
56
  This is incompatible with `auto_show`! Use `auto_save_and_show` instead!
@@ -57,6 +61,7 @@ def auto_save(fname: Path | str, **kwargs: ...):
57
61
  """
58
62
  with auto_close():
59
63
  yield
64
+ plt.tight_layout()
60
65
  plt.savefig(fname, **kwargs)
61
66
 
62
67
 
@@ -65,12 +70,17 @@ def auto_show():
65
70
  """
66
71
  Contextmanager to automatically show and close plots.
67
72
 
73
+ Notes
74
+ -----
75
+ This contextmanager automatically applies `plt.tight_layout()` to the plot.
76
+
68
77
  Warnings
69
78
  --------
70
79
  This is incompatible with `auto_save`! Use `auto_save_and_show` instead!
71
80
  """
72
81
  with auto_close(): # pragma: no cover # plt.show() won't be tested
73
82
  yield
83
+ plt.tight_layout()
74
84
  plt.show()
75
85
 
76
86
 
@@ -90,8 +100,13 @@ def auto_save_and_show(fname: Path | str, **kwargs: ...):
90
100
  ----------------
91
101
  **kwargs
92
102
  Will be passed to `plt.savefig()`.
103
+
104
+ Notes
105
+ -----
106
+ This contextmanager automatically applies `plt.tight_layout()` to the plot.
93
107
  """
94
108
  with auto_close(): # pragma: no cover # plt.show() won't be tested
95
109
  yield
110
+ plt.tight_layout()
96
111
  plt.savefig(fname, **kwargs)
97
112
  plt.show()
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "gypt_matplotlib"
3
- version = "0.2.2"
3
+ version = "0.3.0"
4
4
  description = "A small addon for matplotlib that can be used for the GYPT."
5
5
  authors = [
6
6
  {name = "Keenan Noack", email = "AlbertUnruh@pm.me"}
File without changes