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

10 statements  

« prev     ^ index     » next       coverage.py v7.13.5, created at 2026-04-13 16:59 +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.plot import ( 

22 PlotMixin, 

23 DoubleY, 

24 DoubleYSeparated, 

25 LinePlot, 

26 TimePlot, 

27 BarPlot, 

28 TimeBarPlot, 

29 seconds_to_dates, 

30 format_x_axis_to_date, 

31) 

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

33 

34__all__ = ["set_german_number_format"] 

35 

36__all__.extend( 

37 [ 

38 "PlotMixin", 

39 "DoubleY", 

40 "DoubleYSeparated", 

41 "LinePlot", 

42 "TimePlot", 

43 "BarPlot", 

44 "TimeBarPlot", 

45 "seconds_to_dates", 

46 "format_x_axis_to_date", 

47 ] 

48) 

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