Skip to content
Snippets Groups Projects
Commit 5690234c authored by Felix Fischer's avatar Felix Fischer :shrimp:
Browse files

Merge branch 'more_translation' into 'master'

Added option to only a create a single plot as preview.

See merge request !54
parents 1e70278b 2b050fad
No related branches found
No related tags found
1 merge request!54Added option to only a create a single plot as preview.
Pipeline #1359589 passed
......@@ -93,6 +93,15 @@ All of those functions have the following command-line arguments:
- `xlim`: Set the limits on the x-axis manually.
- `ylim`: Set the limits on the y-axis manually.
### Preview-Mode
It is possible to only create a single plot for every called plot function
to save computation time. This 'preview' mode can be called by setting the
following global variable in `scientific_plots.plot_settings` to true:
```
import scientifc_plots.plot_settings
scientifc_plots.plot_settings.PREVIEW = True
```
## Types
Additional Vector like types for numpy-arrays are provided in
`scientifc_plots.types_`. These types can be used for static type checking
......
......@@ -5,4 +5,4 @@ useful across several different projects and repositories. It also contains
stub-files with several data-type annotations for scipy and matplot-lib
functions."""
__version__ = "1.8.2"
__version__ = "1.8.3"
......@@ -38,6 +38,9 @@ SPINE_COLOR = "black"
FIGSIZE = (3.15, 2.35)
FIGSIZE_SLIM = (3.15, 2.1)
FIGSIZE_SMALL = (2.2, 2.1)
PREVIEW = False # Generate only one set of plots, don't create the whole set
_savefig = copy(plt.savefig) # backup the old save-function
......@@ -532,6 +535,10 @@ def apply_styles(plot_function: Optional[PlotFunction] = None, *,
plt.savefig = new_save_simple(png=False)
_plot_function(*args, **kwargs)
if PREVIEW:
# don't create the styled plots
return
errors = (OSError, FileNotFoundError, ThreeDPlotException,
FallBackException)
......
......@@ -262,7 +262,9 @@ def translate(string: str, reverse: bool = False) -> str:
"absolute pressure": "Absolutdruck",
"relative": "relativ",
"absolute": "absolut",
"plot": "Graph"
"plot": "Graph",
"orifice": "Blende",
"Hagen–Poiseuille": "Hagen-Poiseuille"
})
if not reverse and r"\times" not in string:
for key, value in _dict.items():
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment