diff --git a/_downloads/cd42d7915fea37e5af1df86ab843e0b9/book.yml b/_downloads/cd42d7915fea37e5af1df86ab843e0b9/book.yml index 5025078..e24bc29 100644 --- a/_downloads/cd42d7915fea37e5af1df86ab843e0b9/book.yml +++ b/_downloads/cd42d7915fea37e5af1df86ab843e0b9/book.yml @@ -24,7 +24,8 @@ jobs: python-version: 3.9 - name: Install dependencies manually run: | - pip install jupyter-book matplotlib numpy pandas future cartopy + pip install future matplotlib numpy cartopy pandas requests seaborn jupyter-book scikit-learn ipywidgets + # pip install jupyter-book matplotlib numpy pandas future cartopy pip install pmagpy==4.2.106 pip install -e ./smpsite diff --git a/_images/13dec0bcb55ceeefbaa7e713689e9b4a20e3b8fc68aff7e1c90ddc3967582034.png b/_images/13dec0bcb55ceeefbaa7e713689e9b4a20e3b8fc68aff7e1c90ddc3967582034.png deleted file mode 100644 index 2e39fca..0000000 Binary files a/_images/13dec0bcb55ceeefbaa7e713689e9b4a20e3b8fc68aff7e1c90ddc3967582034.png and /dev/null differ diff --git a/_images/65f0e2bcbab2c7dbdf7f00bfb4809806b8df4ace89593487a994a72300ee8b43.png b/_images/65f0e2bcbab2c7dbdf7f00bfb4809806b8df4ace89593487a994a72300ee8b43.png new file mode 100644 index 0000000..75bf411 Binary files /dev/null and b/_images/65f0e2bcbab2c7dbdf7f00bfb4809806b8df4ace89593487a994a72300ee8b43.png differ diff --git a/_images/812d29482720779fbdbbc93f51b4ab4e62faed7830bf6d65e89c8c3c06d0e98a.png b/_images/812d29482720779fbdbbc93f51b4ab4e62faed7830bf6d65e89c8c3c06d0e98a.png new file mode 100644 index 0000000..529d71f Binary files /dev/null and b/_images/812d29482720779fbdbbc93f51b4ab4e62faed7830bf6d65e89c8c3c06d0e98a.png differ diff --git a/notebooks/Sampling_comparison.html b/notebooks/Sampling_comparison.html index 97a4581..75a0ac5 100644 --- a/notebooks/Sampling_comparison.html +++ b/notebooks/Sampling_comparison.html @@ -435,20 +435,6 @@

Comparison of two sampling strategies -
---------------------------------------------------------------------------
-ModuleNotFoundError                       Traceback (most recent call last)
-Cell In[1], line 4
-      2 import pandas as pd
-      3 import matplotlib.pyplot as plt
-----> 4 import seaborn as sns
-      6 import pmagpy.pmag as pmag
-      7 import pmagpy.ipmag as ipmag
-
-ModuleNotFoundError: No module named 'seaborn'
-
-
-
@@ -494,19 +480,6 @@

Simulation -
---------------------------------------------------------------------------
-NameError                                 Traceback (most recent call last)
-Cell In[2], line 2
-      1 angular_dispersio_within_site = 10 # degrees
-----> 2 kappa_within_site = smp.angular2kappa(angular_dispersio_within_site)
-      3 latitude = 30
-      4 outlier_rate = 0.10
-
-NameError: name 'smp' is not defined
-
-
-
@@ -519,10 +492,64 @@

Simulation
---------------------------------------------------------------------------
-NameError                                 Traceback (most recent call last)
+KeyboardInterrupt                         Traceback (most recent call last)
 File <timed exec>:1
 
-NameError: name 'smp' is not defined
+File ~/work/PaleoSampling/PaleoSampling/smpsite/smpsite/estimate.py:135, in simulate_estimations(params, n_iters, ignore_outliers, seed)
+    131 _iter = 0 
+    133 while _iter < n_iters:
+--> 135     df_sample = generate_samples(params)
+    137     try:
+    138         pole_estimate = estimate_pole(df_sample, params, ignore_outliers=ignore_outliers)
+
+File ~/work/PaleoSampling/PaleoSampling/smpsite/smpsite/sampling.py:124, in generate_samples(params)
+    121 # Convert specimen/sample/directions to VGP space
+    122 samples_dia = np.apply_along_axis(lambda x: pmag.dia_vgp(x[0], x[1], 0, params.site_lat, params.site_long), axis=1, arr = samples_vgp)[:,:2]  
+--> 124 df_ = pd.DataFrame({'sample_site': i,
+    125                     'vgp_long': samples_dia[:,0],
+    126                     'vgp_lat': samples_dia[:,1],
+    127                     'vgp_dec': samples_dec,
+    128                     'vgp_inc': samples_inc,
+    129                     'is_outlier': outliers})
+    130 if i==0:
+    131     df = df_
+
+File /opt/hostedtoolcache/Python/3.9.18/x64/lib/python3.9/site-packages/pandas/core/frame.py:736, in DataFrame.__init__(self, data, index, columns, dtype, copy)
+    730     mgr = self._init_mgr(
+    731         data, axes={"index": index, "columns": columns}, dtype=dtype, copy=copy
+    732     )
+    734 elif isinstance(data, dict):
+    735     # GH#38939 de facto copy defaults to False only in non-dict cases
+--> 736     mgr = dict_to_mgr(data, index, columns, dtype=dtype, copy=copy, typ=manager)
+    737 elif isinstance(data, ma.MaskedArray):
+    738     from numpy.ma import mrecords
+
+File /opt/hostedtoolcache/Python/3.9.18/x64/lib/python3.9/site-packages/pandas/core/internals/construction.py:480, in dict_to_mgr(data, index, columns, dtype, typ, copy)
+    478 else:
+    479     keys = list(data.keys())
+--> 480     columns = Index(keys) if keys else default_index(0)
+    481     arrays = [com.maybe_iterable_to_list(data[k]) for k in keys]
+    483 if copy:
+
+File /opt/hostedtoolcache/Python/3.9.18/x64/lib/python3.9/site-packages/pandas/core/indexes/base.py:509, in Index.__new__(cls, data, dtype, copy, name, tupleize_cols)
+    505 elif is_ea_or_datetimelike_dtype(dtype):
+    506     # non-EA dtype indexes have special casting logic, so we punt here
+    507     pass
+--> 509 elif is_ea_or_datetimelike_dtype(data_dtype):
+    510     pass
+    512 elif isinstance(data, (np.ndarray, Index, ABCSeries)):
+
+File /opt/hostedtoolcache/Python/3.9.18/x64/lib/python3.9/site-packages/pandas/core/dtypes/common.py:1330, in is_ea_or_datetimelike_dtype(dtype)
+   1322 def is_ea_or_datetimelike_dtype(dtype: DtypeObj | None) -> bool:
+   1323     """
+   1324     Check for ExtensionDtype, datetime64 dtype, or timedelta64 dtype.
+   1325 
+   (...)
+   1328     Checks only for dtype objects, not dtype-castable strings or types.
+   1329     """
+-> 1330     return isinstance(dtype, ExtensionDtype) or (lib.is_np_dtype(dtype, "mM"))
+
+KeyboardInterrupt: 
 

@@ -545,20 +572,7 @@

Simulation -
---------------------------------------------------------------------------
-NameError                                 Traceback (most recent call last)
-Cell In[4], line 3
-      1 fig, axes = plt.subplots(nrows=1, ncols=1, figsize=(10,8))
-----> 3 sns.histplot(df_more_sites.error_angle, ax=axes, color='#e84118', stat='probability', binwidth=1, binrange=(0,20), alpha=.7)
-      4 sns.histplot(df_less_sites.error_angle, ax=axes, color='#0097e6', stat='probability', binwidth=1, binrange=(0,20), alpha=.7)
-      6 textstr = '\n'.join((
-      7 r'$RMSE Method 1=%.2f$ (more sites)' % (np.mean(df_more_sites.error_angle**2)**.5, ),
-      8 r'$RMSE Method 2=%.2f$ (less sites)' % (np.mean(df_less_sites.error_angle**2)**.5, )))
-
-NameError: name 'sns' is not defined
-
-
-../_images/13dec0bcb55ceeefbaa7e713689e9b4a20e3b8fc68aff7e1c90ddc3967582034.png +../_images/812d29482720779fbdbbc93f51b4ab4e62faed7830bf6d65e89c8c3c06d0e98a.png

diff --git a/notebooks/Sampling_example.html b/notebooks/Sampling_example.html index 44cead0..18c080b 100644 --- a/notebooks/Sampling_example.html +++ b/notebooks/Sampling_example.html @@ -415,72 +415,6 @@

Example of sampling -
---------------------------------------------------------------------------
-ModuleNotFoundError                       Traceback (most recent call last)
-Cell In[1], line 1
-----> 1 import pmagpy.pmag as pmag
-      2 import pmagpy.ipmag as ipmag
-      3 import matplotlib.pyplot as plt
-
-File /opt/hostedtoolcache/Python/3.9.18/x64/lib/python3.9/site-packages/pmagpy/__init__.py:24
-      5 if sys.version_info <= (3,):
-      6     raise Exception("""
-      7 You are running Python {}.
-      8 This version of pmagpy is only compatible with Python 3.
-   (...)
-     22 
-     23 """.format(sys.version))
----> 24 from . import pmag
-     25 from . import ipmag
-     26 from . import pmagplotlib
-
-File /opt/hostedtoolcache/Python/3.9.18/x64/lib/python3.9/site-packages/pmagpy/pmag.py:19
-     17 from pmag_env import set_env
-     18 import pandas as pd
----> 19 import SPD.lib.leastsq_jacobian as lib_k
-     21 WARNINGS = {'basemap': False, 'cartopy': False}
-     24 def get_version():
-
-File /opt/hostedtoolcache/Python/3.9.18/x64/lib/python3.9/site-packages/SPD/__init__.py:11
-      1 #!/usr/bin/env python
-      2 
-      3 # __init__.py: -*- Python -*-  DESCRIPTIVE TEXT.
-   (...)
-      9 #import os
-     10 #print 'cwd', os.getcwd()
----> 11 import SPD.spd
-     12 import SPD.lib
-     13 SPD.magic_file = 'SPD/magic_measurements.txt'
-
-File /opt/hostedtoolcache/Python/3.9.18/x64/lib/python3.9/site-packages/SPD/spd.py:30
-     25 import os
-     26 #import pylab
-     27 #import scipy
-     28 #from scipy import *
-     29 #import os
----> 30 import SPD.lib.lib_arai_plot_statistics as lib_arai
-     31 #import SPD.lib.lib_curvature as lib_k
-     32 import SPD.lib.leastsq_jacobian as lib_k
-
-File /opt/hostedtoolcache/Python/3.9.18/x64/lib/python3.9/site-packages/SPD/lib/__init__.py:15
-     13 from . import lib_arai_plot_statistics
-     14 from . import lib_curvature
----> 15 from . import leastsq_jacobian
-     16 from . import lib_directional_statistics
-     17 from . import lib_IZZI_MD
-
-File /opt/hostedtoolcache/Python/3.9.18/x64/lib/python3.9/site-packages/SPD/lib/leastsq_jacobian.py:6
-      4 from past.utils import old_div
-      5 import numpy
-----> 6 from scipy import optimize
-      9 # Coordinates of the 2D points                                                                                
-     11 X = [  9, 35, -13,  10,  23,   0]
-
-ModuleNotFoundError: No module named 'scipy'
-
-
-

We define a parameter class defined inside smpsite that allow us to specify all the parameters of interest at the same time. These parameters include: