Coverage for pyrc\visualization\__init__.py: 75%

8 statements  

« prev     ^ index     » next       coverage.py v7.14.1, created at 2026-08-03 16:07 +0200

1# ------------------------------------------------------------------------------- 

2# Copyright (C) 2026 Joel Kimmich, Tim Jourdan 

3# ------------------------------------------------------------------------------ 

4# License 

5# This file is part of PyRC, distributed under GPL-3.0-or-later. 

6# ------------------------------------------------------------------------------ 

7 

8# Locale settings 

9import locale 

10 

11from matplotlib import pyplot as plt 

12 

13 

14def set_german_number_format(): 

15 # Set to German locale to get comma decimal separator 

16 locale.setlocale(locale.LC_NUMERIC, "de_DE.UTF-8") 

17 # if this throw an error you need to call the linux command: sudo locale-gen "de_DE.UTF-8" 

18 plt.rcParams["axes.formatter.use_locale"] = True 

19 

20 

21from pyrc.visualization.vtk_parser import write_pvd, write_static_cells_vtu, write_temperature_vtu 

22 

23__all__ = ["set_german_number_format"] 

24 

25__all__.extend(["write_pvd", "write_static_cells_vtu", "write_temperature_vtu"])