pastastore 1.4.0__py3-none-any.whl → 1.6.0__py3-none-any.whl
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.
- pastastore/__init__.py +2 -4
- pastastore/base.py +206 -59
- pastastore/connectors.py +23 -420
- pastastore/datasets.py +5 -10
- pastastore/plotting.py +27 -14
- pastastore/store.py +522 -73
- pastastore/styling.py +2 -1
- pastastore/util.py +22 -108
- pastastore/version.py +33 -1
- pastastore/yaml_interface.py +33 -25
- {pastastore-1.4.0.dist-info → pastastore-1.6.0.dist-info}/METADATA +15 -14
- pastastore-1.6.0.dist-info/RECORD +15 -0
- {pastastore-1.4.0.dist-info → pastastore-1.6.0.dist-info}/WHEEL +1 -1
- pastastore-1.4.0.dist-info/RECORD +0 -15
- {pastastore-1.4.0.dist-info → pastastore-1.6.0.dist-info}/LICENSE +0 -0
- {pastastore-1.4.0.dist-info → pastastore-1.6.0.dist-info}/top_level.txt +0 -0
pastastore/plotting.py
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"""
|
|
1
|
+
"""Module containing all the plotting methods for PastaStore.
|
|
2
2
|
|
|
3
3
|
Pastastore comes with a number helpful plotting methods to quickly
|
|
4
4
|
visualize time series or the locations of the time series contained in the
|
|
@@ -55,7 +55,7 @@ class Plots:
|
|
|
55
55
|
legend_kwargs=None,
|
|
56
56
|
**kwargs,
|
|
57
57
|
):
|
|
58
|
-
"""
|
|
58
|
+
"""Plot time series from pastastore (internal method).
|
|
59
59
|
|
|
60
60
|
Parameters
|
|
61
61
|
----------
|
|
@@ -507,7 +507,6 @@ class Plots:
|
|
|
507
507
|
ax : matplotlib Axes
|
|
508
508
|
The axes in which the cumulative histogram is plotted
|
|
509
509
|
"""
|
|
510
|
-
|
|
511
510
|
statsdf = self.pstore.get_statistics(
|
|
512
511
|
[statistic], modelnames=modelnames, progressbar=False
|
|
513
512
|
)
|
|
@@ -563,6 +562,23 @@ class Plots:
|
|
|
563
562
|
return ax
|
|
564
563
|
|
|
565
564
|
def compare_models(self, modelnames, ax=None, **kwargs):
|
|
565
|
+
"""Compare multiple models and plot the results.
|
|
566
|
+
|
|
567
|
+
Parameters
|
|
568
|
+
----------
|
|
569
|
+
modelnames : list
|
|
570
|
+
A list of model names to compare.
|
|
571
|
+
ax : matplotlib.axes.Axes, optional
|
|
572
|
+
The axes on which to plot the comparison. If not provided, a new figure
|
|
573
|
+
and axes will be created.
|
|
574
|
+
**kwargs : dict
|
|
575
|
+
Additional keyword arguments to pass to the plot function.
|
|
576
|
+
|
|
577
|
+
Returns
|
|
578
|
+
-------
|
|
579
|
+
cm : pastastore.CompareModels
|
|
580
|
+
The CompareModels object containing the comparison results.
|
|
581
|
+
"""
|
|
566
582
|
models = self.pstore.get_models(modelnames)
|
|
567
583
|
names = []
|
|
568
584
|
onames = [iml.oseries.name for iml in models]
|
|
@@ -644,7 +660,7 @@ class Maps:
|
|
|
644
660
|
ax: matplotlib.Axes
|
|
645
661
|
axes object
|
|
646
662
|
|
|
647
|
-
See
|
|
663
|
+
See Also
|
|
648
664
|
--------
|
|
649
665
|
self.add_background_map
|
|
650
666
|
"""
|
|
@@ -722,11 +738,10 @@ class Maps:
|
|
|
722
738
|
ax: matplotlib.Axes
|
|
723
739
|
axes object
|
|
724
740
|
|
|
725
|
-
See
|
|
741
|
+
See Also
|
|
726
742
|
--------
|
|
727
743
|
self.add_background_map
|
|
728
744
|
"""
|
|
729
|
-
|
|
730
745
|
names = self.pstore.conn._parse_names(names, "oseries")
|
|
731
746
|
if extent is not None:
|
|
732
747
|
names = self.pstore.within(extent, names=names)
|
|
@@ -774,11 +789,10 @@ class Maps:
|
|
|
774
789
|
ax: matplotlib.Axes
|
|
775
790
|
axes object
|
|
776
791
|
|
|
777
|
-
See
|
|
792
|
+
See Also
|
|
778
793
|
--------
|
|
779
794
|
self.add_background_map
|
|
780
795
|
"""
|
|
781
|
-
|
|
782
796
|
model_oseries = [
|
|
783
797
|
self.pstore.get_models(m, return_dict=True)["oseries"]["name"]
|
|
784
798
|
for m in self.pstore.model_names
|
|
@@ -849,7 +863,7 @@ class Maps:
|
|
|
849
863
|
ax: matplotlib.Axes
|
|
850
864
|
axes object
|
|
851
865
|
|
|
852
|
-
See
|
|
866
|
+
See Also
|
|
853
867
|
--------
|
|
854
868
|
self.add_background_map
|
|
855
869
|
"""
|
|
@@ -898,7 +912,7 @@ class Maps:
|
|
|
898
912
|
figsize=(10, 8),
|
|
899
913
|
**kwargs,
|
|
900
914
|
):
|
|
901
|
-
"""
|
|
915
|
+
"""Plot dataframe with point locations (internal method).
|
|
902
916
|
|
|
903
917
|
Can be called directly for more control over plot characteristics.
|
|
904
918
|
|
|
@@ -932,7 +946,6 @@ class Maps:
|
|
|
932
946
|
sc : scatter handle
|
|
933
947
|
scatter plot handle, returned if ax is not None
|
|
934
948
|
"""
|
|
935
|
-
|
|
936
949
|
if ax is None:
|
|
937
950
|
return_scatter = False
|
|
938
951
|
fig, ax = plt.subplots(figsize=figsize)
|
|
@@ -1016,7 +1029,7 @@ class Maps:
|
|
|
1016
1029
|
ax: axes object
|
|
1017
1030
|
axis handle of the resulting figure
|
|
1018
1031
|
|
|
1019
|
-
See
|
|
1032
|
+
See Also
|
|
1020
1033
|
--------
|
|
1021
1034
|
self.add_background_map
|
|
1022
1035
|
"""
|
|
@@ -1102,7 +1115,7 @@ class Maps:
|
|
|
1102
1115
|
uniques = stresses.loc[:, ["stressmodel", "color"]].drop_duplicates(
|
|
1103
1116
|
keep="first"
|
|
1104
1117
|
)
|
|
1105
|
-
for
|
|
1118
|
+
for _, row in uniques.iterrows():
|
|
1106
1119
|
(h,) = ax.plot(
|
|
1107
1120
|
[],
|
|
1108
1121
|
[],
|
|
@@ -1201,7 +1214,7 @@ class Maps:
|
|
|
1201
1214
|
ax: axes object
|
|
1202
1215
|
axis handle of the resulting figure
|
|
1203
1216
|
|
|
1204
|
-
See
|
|
1217
|
+
See Also
|
|
1205
1218
|
--------
|
|
1206
1219
|
self.add_background_map
|
|
1207
1220
|
"""
|