py-pilecore 0.4.1__tar.gz → 0.4.2__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.
Potentially problematic release.
This version of py-pilecore might be problematic. Click here for more details.
- {py_pilecore-0.4.1/src/py_pilecore.egg-info → py_pilecore-0.4.2}/PKG-INFO +1 -1
- {py_pilecore-0.4.1 → py_pilecore-0.4.2}/pyproject.toml +1 -1
- {py_pilecore-0.4.1 → py_pilecore-0.4.2/src/py_pilecore.egg-info}/PKG-INFO +1 -1
- {py_pilecore-0.4.1 → py_pilecore-0.4.2}/src/pypilecore/_version.py +1 -1
- {py_pilecore-0.4.1 → py_pilecore-0.4.2}/src/pypilecore/input/multi_cpt.py +3 -3
- {py_pilecore-0.4.1 → py_pilecore-0.4.2}/src/pypilecore/results/multi_cpt_results.py +161 -0
- {py_pilecore-0.4.1 → py_pilecore-0.4.2}/LICENSE +0 -0
- {py_pilecore-0.4.1 → py_pilecore-0.4.2}/README.md +0 -0
- {py_pilecore-0.4.1 → py_pilecore-0.4.2}/setup.cfg +0 -0
- {py_pilecore-0.4.1 → py_pilecore-0.4.2}/src/py_pilecore.egg-info/SOURCES.txt +0 -0
- {py_pilecore-0.4.1 → py_pilecore-0.4.2}/src/py_pilecore.egg-info/dependency_links.txt +0 -0
- {py_pilecore-0.4.1 → py_pilecore-0.4.2}/src/py_pilecore.egg-info/requires.txt +0 -0
- {py_pilecore-0.4.1 → py_pilecore-0.4.2}/src/py_pilecore.egg-info/top_level.txt +0 -0
- {py_pilecore-0.4.1 → py_pilecore-0.4.2}/src/pypilecore/__init__.py +0 -0
- {py_pilecore-0.4.1 → py_pilecore-0.4.2}/src/pypilecore/api.py +0 -0
- {py_pilecore-0.4.1 → py_pilecore-0.4.2}/src/pypilecore/exceptions.py +0 -0
- {py_pilecore-0.4.1 → py_pilecore-0.4.2}/src/pypilecore/input/__init__.py +0 -0
- {py_pilecore-0.4.1 → py_pilecore-0.4.2}/src/pypilecore/input/grouper_properties.py +0 -0
- {py_pilecore-0.4.1 → py_pilecore-0.4.2}/src/pypilecore/input/pile_properties.py +0 -0
- {py_pilecore-0.4.1 → py_pilecore-0.4.2}/src/pypilecore/input/soil_properties.py +0 -0
- {py_pilecore-0.4.1 → py_pilecore-0.4.2}/src/pypilecore/plot_utils.py +0 -0
- {py_pilecore-0.4.1 → py_pilecore-0.4.2}/src/pypilecore/results/__init__.py +0 -0
- {py_pilecore-0.4.1 → py_pilecore-0.4.2}/src/pypilecore/results/grouper_result.py +0 -0
- {py_pilecore-0.4.1 → py_pilecore-0.4.2}/src/pypilecore/results/load_settlement.py +0 -0
- {py_pilecore-0.4.1 → py_pilecore-0.4.2}/src/pypilecore/results/pile_properties.py +0 -0
- {py_pilecore-0.4.1 → py_pilecore-0.4.2}/src/pypilecore/results/post_processing.py +0 -0
- {py_pilecore-0.4.1 → py_pilecore-0.4.2}/src/pypilecore/results/single_cpt_results.py +0 -0
- {py_pilecore-0.4.1 → py_pilecore-0.4.2}/src/pypilecore/results/soil_properties.py +0 -0
- {py_pilecore-0.4.1 → py_pilecore-0.4.2}/src/pypilecore/utils.py +0 -0
- {py_pilecore-0.4.1 → py_pilecore-0.4.2}/tests/test_input.py +0 -0
|
@@ -313,9 +313,9 @@ def create_multi_cpt_payload(
|
|
|
313
313
|
individual_ocr=individual_ocr,
|
|
314
314
|
)
|
|
315
315
|
pile_properties = create_pile_properties_payload(
|
|
316
|
-
pile_type=pile_type,
|
|
317
|
-
specification=specification,
|
|
318
|
-
installation=installation,
|
|
316
|
+
pile_type=str(pile_type),
|
|
317
|
+
specification=str(specification),
|
|
318
|
+
installation=str(installation),
|
|
319
319
|
pile_shape=pile_shape,
|
|
320
320
|
diameter_base=diameter_base,
|
|
321
321
|
diameter_shaft=diameter_shaft,
|
|
@@ -7,6 +7,7 @@ import matplotlib.pyplot as plt
|
|
|
7
7
|
import numpy as np
|
|
8
8
|
import pandas as pd
|
|
9
9
|
from matplotlib.axes import Axes
|
|
10
|
+
from matplotlib.patches import Patch
|
|
10
11
|
|
|
11
12
|
from pypilecore.exceptions import UserError
|
|
12
13
|
from pypilecore.results.load_settlement import get_load_settlement_plot
|
|
@@ -548,6 +549,166 @@ class MultiCPTBearingResults:
|
|
|
548
549
|
"""The CPTGroupResultsTable dataclass, containing the group results."""
|
|
549
550
|
return self._group_results_table
|
|
550
551
|
|
|
552
|
+
def boxplot(
|
|
553
|
+
self,
|
|
554
|
+
attribute: str,
|
|
555
|
+
axes: Axes | None = None,
|
|
556
|
+
figsize: Tuple[float, float] = (6.0, 6.0),
|
|
557
|
+
show_sqrt: bool = False,
|
|
558
|
+
**kwargs: Any,
|
|
559
|
+
) -> Axes:
|
|
560
|
+
"""
|
|
561
|
+
Plot a box and whisker plot for a given attribute.
|
|
562
|
+
|
|
563
|
+
|
|
564
|
+
.. code-block:: none
|
|
565
|
+
|
|
566
|
+
MIN Q1 median Q3 MAX
|
|
567
|
+
|-----:-----|
|
|
568
|
+
|--------| : |--------|
|
|
569
|
+
|-----:-----|
|
|
570
|
+
|
|
571
|
+
Parameters
|
|
572
|
+
----------
|
|
573
|
+
attribute:
|
|
574
|
+
result attribute to create boxplot. Please note that the attribute name must be present in
|
|
575
|
+
the `CPTResultsTable` and `CPTGroupResultsTable` class.
|
|
576
|
+
axes:
|
|
577
|
+
Optional `Axes` object where the boxplot data can be plotted on.
|
|
578
|
+
If not provided, a new `plt.Figure` will be activated and the `Axes`
|
|
579
|
+
object will be created and returned.
|
|
580
|
+
figsize:
|
|
581
|
+
Size of the activate figure, as the `plt.figure()` argument.
|
|
582
|
+
show_sqrt:
|
|
583
|
+
Add sqrt(2) bandwidth to figure
|
|
584
|
+
**kwargs:
|
|
585
|
+
All additional keyword arguments are passed to the `pyplot.subplots()` call.
|
|
586
|
+
|
|
587
|
+
Returns
|
|
588
|
+
-------
|
|
589
|
+
axes:
|
|
590
|
+
The `Axes` object where the settlement curves were plotted on
|
|
591
|
+
"""
|
|
592
|
+
|
|
593
|
+
# validate attribute
|
|
594
|
+
if (
|
|
595
|
+
attribute not in self.cpt_results.results[0].table.__dict__.keys()
|
|
596
|
+
or attribute not in self.group_results_table.__dict__.keys()
|
|
597
|
+
):
|
|
598
|
+
raise ValueError(
|
|
599
|
+
f"""
|
|
600
|
+
{attribute} is not present in CPTResultsTable or CPTGroupResultsTable class.
|
|
601
|
+
Please select on of the following attributes:
|
|
602
|
+
{
|
|
603
|
+
set(self.cpt_results.results[0].table.__dict__.keys())
|
|
604
|
+
& set(self.group_results_table.__dict__.keys())
|
|
605
|
+
}
|
|
606
|
+
"""
|
|
607
|
+
)
|
|
608
|
+
|
|
609
|
+
# Create axes objects if not provided
|
|
610
|
+
if axes is not None:
|
|
611
|
+
if not isinstance(axes, Axes):
|
|
612
|
+
raise ValueError(
|
|
613
|
+
"'axes' argument to boxplot() must be a `pyplot.axes.Axes` object or None."
|
|
614
|
+
)
|
|
615
|
+
else:
|
|
616
|
+
kwargs_subplot = {
|
|
617
|
+
"figsize": figsize,
|
|
618
|
+
"tight_layout": True,
|
|
619
|
+
}
|
|
620
|
+
|
|
621
|
+
kwargs_subplot.update(kwargs)
|
|
622
|
+
|
|
623
|
+
_, axes = plt.subplots(
|
|
624
|
+
1,
|
|
625
|
+
1,
|
|
626
|
+
**kwargs_subplot,
|
|
627
|
+
)
|
|
628
|
+
|
|
629
|
+
if not isinstance(axes, Axes):
|
|
630
|
+
raise ValueError(
|
|
631
|
+
"Could not create Axes objects. This is probably due to invalid matplotlib keyword arguments. "
|
|
632
|
+
)
|
|
633
|
+
|
|
634
|
+
# Collect data from single calculation
|
|
635
|
+
data = np.array(
|
|
636
|
+
[
|
|
637
|
+
item.table.__getattribute__(attribute)
|
|
638
|
+
for item in self.cpt_results.results
|
|
639
|
+
]
|
|
640
|
+
)
|
|
641
|
+
|
|
642
|
+
# Draw a box and whisker plot
|
|
643
|
+
axes.boxplot(
|
|
644
|
+
np.flip(data, axis=0),
|
|
645
|
+
labels=np.flip(self.group_results_table.pile_tip_level_nap),
|
|
646
|
+
whis=(0, 100),
|
|
647
|
+
autorange=True,
|
|
648
|
+
vert=False,
|
|
649
|
+
patch_artist=True,
|
|
650
|
+
showmeans=True,
|
|
651
|
+
zorder=0,
|
|
652
|
+
)
|
|
653
|
+
|
|
654
|
+
# ad additional bandwidth of sqrt(2) of the mean value
|
|
655
|
+
if show_sqrt:
|
|
656
|
+
axes.scatter(
|
|
657
|
+
np.flip(data.mean(axis=0)) * np.sqrt(2),
|
|
658
|
+
np.flip(
|
|
659
|
+
np.arange(len(self.group_results_table.pile_tip_level_nap)) + 1
|
|
660
|
+
),
|
|
661
|
+
marker="^",
|
|
662
|
+
color="tab:purple",
|
|
663
|
+
zorder=1,
|
|
664
|
+
)
|
|
665
|
+
axes.scatter(
|
|
666
|
+
np.flip(data.mean(axis=0)) / np.sqrt(2),
|
|
667
|
+
np.flip(
|
|
668
|
+
np.arange(len(self.group_results_table.pile_tip_level_nap)) + 1
|
|
669
|
+
),
|
|
670
|
+
marker="^",
|
|
671
|
+
color="tab:purple",
|
|
672
|
+
zorder=1,
|
|
673
|
+
)
|
|
674
|
+
|
|
675
|
+
# Draw group result over single result
|
|
676
|
+
axes.scatter(
|
|
677
|
+
np.flip(self.group_results_table.__getattribute__(attribute)),
|
|
678
|
+
np.flip(np.arange(len(self.group_results_table.pile_tip_level_nap)) + 1),
|
|
679
|
+
marker="o",
|
|
680
|
+
color="tab:red",
|
|
681
|
+
zorder=1,
|
|
682
|
+
)
|
|
683
|
+
|
|
684
|
+
# Draw group result over single result
|
|
685
|
+
for i, x in enumerate(data.mean(axis=0)):
|
|
686
|
+
axes.annotate(f"{x.round(2)}", xy=(x, i + 1))
|
|
687
|
+
|
|
688
|
+
# add legend to figure
|
|
689
|
+
axes.legend(
|
|
690
|
+
handles=[
|
|
691
|
+
Patch(color=clr, label=key)
|
|
692
|
+
for (key, clr) in {
|
|
693
|
+
"Single;min:max": "black",
|
|
694
|
+
"Single;Q25:Q75": "tab:blue",
|
|
695
|
+
"Single;Q50": "tab:orange",
|
|
696
|
+
"Single;mean": "tab:green",
|
|
697
|
+
"Single;mean;sqrt": "tab:purple",
|
|
698
|
+
"Group;normative": "tab:red",
|
|
699
|
+
}.items()
|
|
700
|
+
],
|
|
701
|
+
loc="upper left",
|
|
702
|
+
bbox_to_anchor=(1, 1),
|
|
703
|
+
title=f"Bandwidth {attribute}",
|
|
704
|
+
)
|
|
705
|
+
|
|
706
|
+
# set label
|
|
707
|
+
axes.set_ylabel("Depth [m NAP]")
|
|
708
|
+
axes.set_xlabel(f"{attribute}")
|
|
709
|
+
|
|
710
|
+
return axes
|
|
711
|
+
|
|
551
712
|
def plot_load_settlement(
|
|
552
713
|
self,
|
|
553
714
|
pile_tip_level_nap: float,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|