diff --git a/pyprophet/cli/score.py b/pyprophet/cli/score.py index a3d7042f..aff5503a 100644 --- a/pyprophet/cli/score.py +++ b/pyprophet/cli/score.py @@ -373,13 +373,13 @@ def score( ctx.obj["LOG_HEADER"], ) - # Validate file type and subsample ratio, subsample_ratio is currently only applicateble for "parquet_split", "parquet_split_multi". If this combination is not met, throw warning and set subsample_ratio to 1.0 + # Validate file type and subsample ratio. OSW, parquet, parquet_split, and parquet_split_multi all support subsampling if ( - config.file_type not in ["parquet", "parquet_split", "parquet_split_multi"] + config.file_type not in ["osw", "parquet", "parquet_split", "parquet_split_multi"] and subsample_ratio < 1.0 ): logger.warning( - "Semi-supervised learning on a subset of the data, and then applying the weights to the full data is currently only supported for `parquet_split` and `parquet_split_multi` files.\nFor `osw`, you need to manually subsample the osw using the `subsample` module.\nSetting subsample_ratio to 1.0.", + "Semi-supervised learning on a subset of the data, and then applying the weights to the full data is currently only supported for OSW, `parquet`, `parquet_split`, and `parquet_split_multi` files.\nFor TSV and other formats, you need to manually prepare a subsampled input file.\nSetting subsample_ratio to 1.0.", ) config.subsample_ratio = 1.0 diff --git a/pyprophet/io/_base.py b/pyprophet/io/_base.py index a6d35246..5ddd50d4 100644 --- a/pyprophet/io/_base.py +++ b/pyprophet/io/_base.py @@ -38,6 +38,7 @@ """ import glob +import math import os import pickle import sys @@ -993,6 +994,7 @@ class BaseOSWReader(BaseReader): Methods: read(): Read data from the input file based on the alogorithm. + _init_duckdb_views(): Initialize DuckDB views with optional subsampling. """ def __init__(self, config: BaseIOConfig): @@ -1006,6 +1008,41 @@ def read(self) -> pd.DataFrame: "The read method must be implemented in subclasses of BaseOSWReader." ) + def _init_duckdb_views(self, con): + """ + Initialize DuckDB views for the OSW file with optional subsampling support. + + Creates a TEMP table of sampled precursor IDs if subsample_ratio < 1.0, + which can be used by subclasses to filter feature queries. + + Subclasses should call this method before creating feature views and then + filter views with: WHERE PRECURSOR_ID IN (SELECT PRECURSOR_ID FROM sampled_precursor_ids) + when self.subsample_ratio < 1.0. + + Args: + con: DuckDB connection with OSW database attached as 'osw' + """ + # Create TEMP table of sampled precursor IDs (if needed) + if self.subsample_ratio < 1.0: + logger.info( + f"Subsampling data for semi-supervised learning. Ratio: {self.subsample_ratio:.2f}" + ) + precursor_count = con.execute( + "SELECT COUNT(DISTINCT ID) FROM osw.PRECURSOR" + ).fetchone()[0] + sample_size = max(1, math.ceil(precursor_count * self.subsample_ratio)) + con.execute( + f""" + CREATE TEMP TABLE sampled_precursor_ids AS + SELECT DISTINCT ID AS PRECURSOR_ID + FROM osw.PRECURSOR + ORDER BY hash(ID) + LIMIT {sample_size} + """ + ) + n = con.execute("SELECT COUNT(*) FROM sampled_precursor_ids").fetchone()[0] + logger.info(f"Sampled {n} precursor IDs") + @dataclass class BaseOSWWriter(BaseWriter): diff --git a/pyprophet/io/scoring/osw.py b/pyprophet/io/scoring/osw.py index 32e1d0fd..29e6c4c1 100644 --- a/pyprophet/io/scoring/osw.py +++ b/pyprophet/io/scoring/osw.py @@ -46,6 +46,7 @@ def read(self) -> pd.DataFrame: con.execute("INSTALL sqlite_scanner;") con.execute("LOAD sqlite_scanner;") con.execute(f"ATTACH DATABASE '{self.infile}' AS osw (TYPE sqlite);") + self._init_duckdb_views(con) return self._read_using_duckdb(con) except ModuleNotFoundError as e: logger.warning( @@ -148,15 +149,27 @@ def _fetch_tables_duckdb(self, con): ).fetchdf() return tables + def _get_precursor_filter_clause(self): + """ + Return a WHERE/AND clause fragment for filtering by sampled precursor IDs when subsampling is enabled. + Returns empty string if no subsampling, otherwise returns a clause like: + " AND f.PRECURSOR_ID IN (SELECT PRECURSOR_ID FROM sampled_precursor_ids)" + """ + if self.subsample_ratio < 1.0: + return " AND f.PRECURSOR_ID IN (SELECT PRECURSOR_ID FROM sampled_precursor_ids)" + return "" + def _fetch_ms2_features_duckdb(self, con): if not check_duckdb_table(con, "main", "FEATURE_MS2"): raise click.ClickException( f"MS2-level feature table not present in file.\nTable Info:\n{self._fetch_tables_duckdb(con)}" ) + filter_clause = self._get_precursor_filter_clause() + if self.glyco: con.execute( - """ + f""" CREATE OR REPLACE VIEW ms2_table AS SELECT fm.*, @@ -189,11 +202,12 @@ def _fetch_ms2_features_duckdb(self, con): WHERE t.DETECTING = 1 GROUP BY tpm.PRECURSOR_ID ) ts ON f.PRECURSOR_ID = ts.PRECURSOR_ID + WHERE 1=1{filter_clause} """ ) else: con.execute( - """ + f""" CREATE OR REPLACE VIEW ms2_table AS SELECT fm.*, @@ -216,6 +230,7 @@ def _fetch_ms2_features_duckdb(self, con): WHERE t.DETECTING = 1 GROUP BY tpm.PRECURSOR_ID ) ts ON f.PRECURSOR_ID = ts.PRECURSOR_ID + WHERE 1=1{filter_clause} """ ) @@ -243,10 +258,11 @@ def _fetch_ms1_features_duckdb(self, con): rc = self.config.runner glyco = rc.glyco ipf_max_rank = rc.ipf_max_peakgroup_rank + filter_clause = self._get_precursor_filter_clause() if not glyco: con.execute( - """ + f""" CREATE OR REPLACE VIEW ms1_table AS SELECT fm.*, f.RUN_ID, f.PRECURSOR_ID, f.EXP_RT, p.CHARGE AS PRECURSOR_CHARGE, p.DECOY, @@ -254,6 +270,7 @@ def _fetch_ms1_features_duckdb(self, con): FROM osw.FEATURE_MS1 fm INNER JOIN osw.FEATURE f ON fm.FEATURE_ID = f.ID INNER JOIN osw.PRECURSOR p ON f.PRECURSOR_ID = p.ID + WHERE 1=1{filter_clause} ORDER BY f.RUN_ID, p.ID, f.EXP_RT """ ) @@ -281,7 +298,7 @@ def _fetch_ms1_features_duckdb(self, con): FROM osw.PRECURSOR_GLYCOPEPTIDE_MAPPING pgm INNER JOIN osw.GLYCOPEPTIDE gp ON pgm.GLYCOPEPTIDE_ID = gp.ID ) g ON f.PRECURSOR_ID = g.PRECURSOR_ID - WHERE s.RANK <= {ipf_max_rank} + WHERE s.RANK <= {ipf_max_rank}{filter_clause} ORDER BY f.RUN_ID, p.ID, f.EXP_RT """ ) @@ -303,6 +320,7 @@ def _fetch_transition_features_duckdb(self, con): ) rc = self.config.runner + filter_clause = self._get_precursor_filter_clause() con.execute( f""" CREATE OR REPLACE VIEW transition_table AS @@ -324,7 +342,7 @@ def _fetch_transition_features_duckdb(self, con): AND s.PEP <= {rc.ipf_max_peakgroup_pep} AND ft.VAR_ISOTOPE_OVERLAP_SCORE <= {rc.ipf_max_transition_isotope_overlap} AND ft.VAR_LOG_SN_SCORE > {rc.ipf_min_transition_sn} - AND p.DECOY = 0 + AND p.DECOY = 0{filter_clause} """ ) df = con.execute( @@ -342,8 +360,10 @@ def _fetch_alignment_features_duckdb(self, con): raise click.ClickException( f"MS2-level feature alignment table not present in file.\nTable Info:\n{self._fetch_tables_duckdb(con)}" ) + + filter_clause = self._get_precursor_filter_clause() con.execute( - """ + f""" CREATE OR REPLACE VIEW alignment_table AS SELECT fa.ALIGNMENT_ID AS ALIGNMENT_ID, fa.RUN_ID, @@ -359,6 +379,7 @@ def _fetch_alignment_features_duckdb(self, con): fa.PEAK_INTENSITY_RATIO AS VAR_PEAK_INTENSITY_RATIO, fa.ALIGNED_FEATURE_ID || '_' || fa.PRECURSOR_ID AS GROUP_ID FROM osw.FEATURE_MS2_ALIGNMENT fa + WHERE 1=1{filter_clause} ORDER BY fa.RUN_ID, fa.PRECURSOR_ID, fa.REFERENCE_RT """ ) @@ -692,10 +713,10 @@ def save_results(self, result, pi0): def save_weights(self, weights): """ Save the weights to a SQLite database based on the classifier type. - If classifier is "LDA", weights are saved to PYPROPHET_WEIGHTS table. + If classifier is "LDA" or "SVM", weights are saved to PYPROPHET_WEIGHTS table. If classifier is "XGBoost", weights are saved to PYPROPHET_XGB or GLYCOPEPTIDEPROPHET_XGB table based on glyco and level. """ - if self.classifier == "LDA": + if self.classifier in ("LDA", "SVM"): weights["level"] = self.level con = sqlite3.connect(self.outfile) @@ -722,6 +743,7 @@ def save_weights(self, weights): # print(weights) weights.to_sql("PYPROPHET_WEIGHTS", con, index=False, if_exists="append") + con.commit() elif self.classifier == "XGBoost": con = sqlite3.connect(self.outfile) diff --git a/pyprophet/scoring/_optimized.c b/pyprophet/scoring/_optimized.c index 577348cf..0e2d000d 100644 --- a/pyprophet/scoring/_optimized.c +++ b/pyprophet/scoring/_optimized.c @@ -1382,7 +1382,7 @@ static const char *__pyx_filename; static const char* const __pyx_f[] = { "pyprophet/scoring/_optimized.pyx", "", - "../../../../../tmp/pip-build-env-_q1myxj8/overlay/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd", + "../../../../../tmp/pip-build-env-4954wg_r/overlay/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd", "cpython/type.pxd", }; /* #### Code section: utility_code_proto_before_types ### */ @@ -1635,7 +1635,7 @@ typedef struct { /* #### Code section: numeric_typedefs ### */ -/* "../../../../../tmp/pip-build-env-_q1myxj8/overlay/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":770 +/* "../../../../../tmp/pip-build-env-4954wg_r/overlay/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":744 * # in Cython to enable them only on the right systems. * * ctypedef npy_int8 int8_t # <<<<<<<<<<<<<< @@ -1644,7 +1644,7 @@ typedef struct { */ typedef npy_int8 __pyx_t_5numpy_int8_t; -/* "../../../../../tmp/pip-build-env-_q1myxj8/overlay/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":771 +/* "../../../../../tmp/pip-build-env-4954wg_r/overlay/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":745 * * ctypedef npy_int8 int8_t * ctypedef npy_int16 int16_t # <<<<<<<<<<<<<< @@ -1653,26 +1653,26 @@ typedef npy_int8 __pyx_t_5numpy_int8_t; */ typedef npy_int16 __pyx_t_5numpy_int16_t; -/* "../../../../../tmp/pip-build-env-_q1myxj8/overlay/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":772 +/* "../../../../../tmp/pip-build-env-4954wg_r/overlay/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":746 * ctypedef npy_int8 int8_t * ctypedef npy_int16 int16_t * ctypedef npy_int32 int32_t # <<<<<<<<<<<<<< * ctypedef npy_int64 int64_t - * #ctypedef npy_int96 int96_t + * */ typedef npy_int32 __pyx_t_5numpy_int32_t; -/* "../../../../../tmp/pip-build-env-_q1myxj8/overlay/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":773 +/* "../../../../../tmp/pip-build-env-4954wg_r/overlay/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":747 * ctypedef npy_int16 int16_t * ctypedef npy_int32 int32_t * ctypedef npy_int64 int64_t # <<<<<<<<<<<<<< - * #ctypedef npy_int96 int96_t - * #ctypedef npy_int128 int128_t + * + * ctypedef npy_uint8 uint8_t */ typedef npy_int64 __pyx_t_5numpy_int64_t; -/* "../../../../../tmp/pip-build-env-_q1myxj8/overlay/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":777 - * #ctypedef npy_int128 int128_t +/* "../../../../../tmp/pip-build-env-4954wg_r/overlay/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":749 + * ctypedef npy_int64 int64_t * * ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<< * ctypedef npy_uint16 uint16_t @@ -1680,7 +1680,7 @@ typedef npy_int64 __pyx_t_5numpy_int64_t; */ typedef npy_uint8 __pyx_t_5numpy_uint8_t; -/* "../../../../../tmp/pip-build-env-_q1myxj8/overlay/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":778 +/* "../../../../../tmp/pip-build-env-4954wg_r/overlay/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":750 * * ctypedef npy_uint8 uint8_t * ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<< @@ -1689,26 +1689,26 @@ typedef npy_uint8 __pyx_t_5numpy_uint8_t; */ typedef npy_uint16 __pyx_t_5numpy_uint16_t; -/* "../../../../../tmp/pip-build-env-_q1myxj8/overlay/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":779 +/* "../../../../../tmp/pip-build-env-4954wg_r/overlay/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":751 * ctypedef npy_uint8 uint8_t * ctypedef npy_uint16 uint16_t * ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<< * ctypedef npy_uint64 uint64_t - * #ctypedef npy_uint96 uint96_t + * */ typedef npy_uint32 __pyx_t_5numpy_uint32_t; -/* "../../../../../tmp/pip-build-env-_q1myxj8/overlay/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":780 +/* "../../../../../tmp/pip-build-env-4954wg_r/overlay/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":752 * ctypedef npy_uint16 uint16_t * ctypedef npy_uint32 uint32_t * ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<< - * #ctypedef npy_uint96 uint96_t - * #ctypedef npy_uint128 uint128_t + * + * ctypedef npy_float32 float32_t */ typedef npy_uint64 __pyx_t_5numpy_uint64_t; -/* "../../../../../tmp/pip-build-env-_q1myxj8/overlay/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":784 - * #ctypedef npy_uint128 uint128_t +/* "../../../../../tmp/pip-build-env-4954wg_r/overlay/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":754 + * ctypedef npy_uint64 uint64_t * * ctypedef npy_float32 float32_t # <<<<<<<<<<<<<< * ctypedef npy_float64 float64_t @@ -1716,7 +1716,7 @@ typedef npy_uint64 __pyx_t_5numpy_uint64_t; */ typedef npy_float32 __pyx_t_5numpy_float32_t; -/* "../../../../../tmp/pip-build-env-_q1myxj8/overlay/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":785 +/* "../../../../../tmp/pip-build-env-4954wg_r/overlay/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":755 * * ctypedef npy_float32 float32_t * ctypedef npy_float64 float64_t # <<<<<<<<<<<<<< @@ -1725,7 +1725,7 @@ typedef npy_float32 __pyx_t_5numpy_float32_t; */ typedef npy_float64 __pyx_t_5numpy_float64_t; -/* "../../../../../tmp/pip-build-env-_q1myxj8/overlay/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":792 +/* "../../../../../tmp/pip-build-env-4954wg_r/overlay/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":762 * ctypedef double complex complex128_t * * ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<< @@ -1734,7 +1734,7 @@ typedef npy_float64 __pyx_t_5numpy_float64_t; */ typedef npy_longlong __pyx_t_5numpy_longlong_t; -/* "../../../../../tmp/pip-build-env-_q1myxj8/overlay/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":793 +/* "../../../../../tmp/pip-build-env-4954wg_r/overlay/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":763 * * ctypedef npy_longlong longlong_t * ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<< @@ -1743,7 +1743,7 @@ typedef npy_longlong __pyx_t_5numpy_longlong_t; */ typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t; -/* "../../../../../tmp/pip-build-env-_q1myxj8/overlay/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":795 +/* "../../../../../tmp/pip-build-env-4954wg_r/overlay/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":765 * ctypedef npy_ulonglong ulonglong_t * * ctypedef npy_intp intp_t # <<<<<<<<<<<<<< @@ -1752,7 +1752,7 @@ typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t; */ typedef npy_intp __pyx_t_5numpy_intp_t; -/* "../../../../../tmp/pip-build-env-_q1myxj8/overlay/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":796 +/* "../../../../../tmp/pip-build-env-4954wg_r/overlay/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":766 * * ctypedef npy_intp intp_t * ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<< @@ -1761,7 +1761,7 @@ typedef npy_intp __pyx_t_5numpy_intp_t; */ typedef npy_uintp __pyx_t_5numpy_uintp_t; -/* "../../../../../tmp/pip-build-env-_q1myxj8/overlay/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":798 +/* "../../../../../tmp/pip-build-env-4954wg_r/overlay/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":768 * ctypedef npy_uintp uintp_t * * ctypedef npy_double float_t # <<<<<<<<<<<<<< @@ -1770,7 +1770,7 @@ typedef npy_uintp __pyx_t_5numpy_uintp_t; */ typedef npy_double __pyx_t_5numpy_float_t; -/* "../../../../../tmp/pip-build-env-_q1myxj8/overlay/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":799 +/* "../../../../../tmp/pip-build-env-4954wg_r/overlay/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":769 * * ctypedef npy_double float_t * ctypedef npy_double double_t # <<<<<<<<<<<<<< @@ -1779,7 +1779,7 @@ typedef npy_double __pyx_t_5numpy_float_t; */ typedef npy_double __pyx_t_5numpy_double_t; -/* "../../../../../tmp/pip-build-env-_q1myxj8/overlay/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":800 +/* "../../../../../tmp/pip-build-env-4954wg_r/overlay/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":770 * ctypedef npy_double float_t * ctypedef npy_double double_t * ctypedef npy_longdouble longdouble_t # <<<<<<<<<<<<<< @@ -1841,24 +1841,6 @@ struct __pyx_MemviewEnum_obj; struct __pyx_memoryview_obj; struct __pyx_memoryviewslice_obj; -/* "../../../../../tmp/pip-build-env-_q1myxj8/overlay/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1096 - * - * # Iterator API added in v1.6 - * ctypedef int (*NpyIter_IterNextFunc)(NpyIter* it) noexcept nogil # <<<<<<<<<<<<<< - * ctypedef void (*NpyIter_GetMultiIndexFunc)(NpyIter* it, npy_intp* outcoords) noexcept nogil - * -*/ -typedef int (*__pyx_t_5numpy_NpyIter_IterNextFunc)(NpyIter *); - -/* "../../../../../tmp/pip-build-env-_q1myxj8/overlay/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1097 - * # Iterator API added in v1.6 - * ctypedef int (*NpyIter_IterNextFunc)(NpyIter* it) noexcept nogil - * ctypedef void (*NpyIter_GetMultiIndexFunc)(NpyIter* it, npy_intp* outcoords) noexcept nogil # <<<<<<<<<<<<<< - * - * cdef extern from "numpy/arrayobject.h": -*/ -typedef void (*__pyx_t_5numpy_NpyIter_GetMultiIndexFunc)(NpyIter *, npy_intp *); - /* "View.MemoryView":110 * * @@ -17088,7 +17070,7 @@ static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *__ return __pyx_r; } -/* "../../../../../tmp/pip-build-env-_q1myxj8/overlay/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":285 +/* "../../../../../tmp/pip-build-env-4954wg_r/overlay/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":243 * cdef int type_num * * @property # <<<<<<<<<<<<<< @@ -17099,7 +17081,7 @@ static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *__ static CYTHON_INLINE npy_intp __pyx_f_5numpy_5dtype_8itemsize_itemsize(PyArray_Descr *__pyx_v_self) { npy_intp __pyx_r; - /* "../../../../../tmp/pip-build-env-_q1myxj8/overlay/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":287 + /* "../../../../../tmp/pip-build-env-4954wg_r/overlay/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":245 * @property * cdef inline npy_intp itemsize(self) noexcept nogil: * return PyDataType_ELSIZE(self) # <<<<<<<<<<<<<< @@ -17109,7 +17091,7 @@ static CYTHON_INLINE npy_intp __pyx_f_5numpy_5dtype_8itemsize_itemsize(PyArray_D __pyx_r = PyDataType_ELSIZE(__pyx_v_self); goto __pyx_L0; - /* "../../../../../tmp/pip-build-env-_q1myxj8/overlay/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":285 + /* "../../../../../tmp/pip-build-env-4954wg_r/overlay/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":243 * cdef int type_num * * @property # <<<<<<<<<<<<<< @@ -17122,7 +17104,7 @@ static CYTHON_INLINE npy_intp __pyx_f_5numpy_5dtype_8itemsize_itemsize(PyArray_D return __pyx_r; } -/* "../../../../../tmp/pip-build-env-_q1myxj8/overlay/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":289 +/* "../../../../../tmp/pip-build-env-4954wg_r/overlay/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":247 * return PyDataType_ELSIZE(self) * * @property # <<<<<<<<<<<<<< @@ -17133,7 +17115,7 @@ static CYTHON_INLINE npy_intp __pyx_f_5numpy_5dtype_8itemsize_itemsize(PyArray_D static CYTHON_INLINE npy_intp __pyx_f_5numpy_5dtype_9alignment_alignment(PyArray_Descr *__pyx_v_self) { npy_intp __pyx_r; - /* "../../../../../tmp/pip-build-env-_q1myxj8/overlay/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":291 + /* "../../../../../tmp/pip-build-env-4954wg_r/overlay/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":249 * @property * cdef inline npy_intp alignment(self) noexcept nogil: * return PyDataType_ALIGNMENT(self) # <<<<<<<<<<<<<< @@ -17143,7 +17125,7 @@ static CYTHON_INLINE npy_intp __pyx_f_5numpy_5dtype_9alignment_alignment(PyArray __pyx_r = PyDataType_ALIGNMENT(__pyx_v_self); goto __pyx_L0; - /* "../../../../../tmp/pip-build-env-_q1myxj8/overlay/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":289 + /* "../../../../../tmp/pip-build-env-4954wg_r/overlay/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":247 * return PyDataType_ELSIZE(self) * * @property # <<<<<<<<<<<<<< @@ -17156,7 +17138,7 @@ static CYTHON_INLINE npy_intp __pyx_f_5numpy_5dtype_9alignment_alignment(PyArray return __pyx_r; } -/* "../../../../../tmp/pip-build-env-_q1myxj8/overlay/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":295 +/* "../../../../../tmp/pip-build-env-4954wg_r/overlay/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":253 * # Use fields/names with care as they may be NULL. You must check * # for this using PyDataType_HASFIELDS. * @property # <<<<<<<<<<<<<< @@ -17170,7 +17152,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_5dtype_6fields_fields(PyArray_Desc PyObject *__pyx_t_1; __Pyx_RefNannySetupContext("fields", 0); - /* "../../../../../tmp/pip-build-env-_q1myxj8/overlay/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":297 + /* "../../../../../tmp/pip-build-env-4954wg_r/overlay/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":255 * @property * cdef inline object fields(self): * return PyDataType_FIELDS(self) # <<<<<<<<<<<<<< @@ -17183,7 +17165,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_5dtype_6fields_fields(PyArray_Desc __pyx_r = ((PyObject *)__pyx_t_1); goto __pyx_L0; - /* "../../../../../tmp/pip-build-env-_q1myxj8/overlay/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":295 + /* "../../../../../tmp/pip-build-env-4954wg_r/overlay/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":253 * # Use fields/names with care as they may be NULL. You must check * # for this using PyDataType_HASFIELDS. * @property # <<<<<<<<<<<<<< @@ -17198,7 +17180,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_5dtype_6fields_fields(PyArray_Desc return __pyx_r; } -/* "../../../../../tmp/pip-build-env-_q1myxj8/overlay/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":299 +/* "../../../../../tmp/pip-build-env-4954wg_r/overlay/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":257 * return PyDataType_FIELDS(self) * * @property # <<<<<<<<<<<<<< @@ -17212,7 +17194,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_5dtype_5names_names(PyArray_Descr PyObject *__pyx_t_1; __Pyx_RefNannySetupContext("names", 0); - /* "../../../../../tmp/pip-build-env-_q1myxj8/overlay/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":301 + /* "../../../../../tmp/pip-build-env-4954wg_r/overlay/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":259 * @property * cdef inline tuple names(self): * return PyDataType_NAMES(self) # <<<<<<<<<<<<<< @@ -17225,7 +17207,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_5dtype_5names_names(PyArray_Descr __pyx_r = ((PyObject*)__pyx_t_1); goto __pyx_L0; - /* "../../../../../tmp/pip-build-env-_q1myxj8/overlay/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":299 + /* "../../../../../tmp/pip-build-env-4954wg_r/overlay/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":257 * return PyDataType_FIELDS(self) * * @property # <<<<<<<<<<<<<< @@ -17240,7 +17222,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_5dtype_5names_names(PyArray_Descr return __pyx_r; } -/* "../../../../../tmp/pip-build-env-_q1myxj8/overlay/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":306 +/* "../../../../../tmp/pip-build-env-4954wg_r/overlay/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":264 * # valid (the pointer can be NULL). Most users should access * # this field via the inline helper method PyDataType_SHAPE. * @property # <<<<<<<<<<<<<< @@ -17251,7 +17233,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_5dtype_5names_names(PyArray_Descr static CYTHON_INLINE PyArray_ArrayDescr *__pyx_f_5numpy_5dtype_8subarray_subarray(PyArray_Descr *__pyx_v_self) { PyArray_ArrayDescr *__pyx_r; - /* "../../../../../tmp/pip-build-env-_q1myxj8/overlay/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":308 + /* "../../../../../tmp/pip-build-env-4954wg_r/overlay/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":266 * @property * cdef inline PyArray_ArrayDescr* subarray(self) noexcept nogil: * return PyDataType_SUBARRAY(self) # <<<<<<<<<<<<<< @@ -17261,7 +17243,7 @@ static CYTHON_INLINE PyArray_ArrayDescr *__pyx_f_5numpy_5dtype_8subarray_subarra __pyx_r = PyDataType_SUBARRAY(__pyx_v_self); goto __pyx_L0; - /* "../../../../../tmp/pip-build-env-_q1myxj8/overlay/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":306 + /* "../../../../../tmp/pip-build-env-4954wg_r/overlay/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":264 * # valid (the pointer can be NULL). Most users should access * # this field via the inline helper method PyDataType_SHAPE. * @property # <<<<<<<<<<<<<< @@ -17274,7 +17256,7 @@ static CYTHON_INLINE PyArray_ArrayDescr *__pyx_f_5numpy_5dtype_8subarray_subarra return __pyx_r; } -/* "../../../../../tmp/pip-build-env-_q1myxj8/overlay/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":310 +/* "../../../../../tmp/pip-build-env-4954wg_r/overlay/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":268 * return PyDataType_SUBARRAY(self) * * @property # <<<<<<<<<<<<<< @@ -17285,7 +17267,7 @@ static CYTHON_INLINE PyArray_ArrayDescr *__pyx_f_5numpy_5dtype_8subarray_subarra static CYTHON_INLINE npy_uint64 __pyx_f_5numpy_5dtype_5flags_flags(PyArray_Descr *__pyx_v_self) { npy_uint64 __pyx_r; - /* "../../../../../tmp/pip-build-env-_q1myxj8/overlay/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":313 + /* "../../../../../tmp/pip-build-env-4954wg_r/overlay/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":271 * cdef inline npy_uint64 flags(self) noexcept nogil: * """The data types flags.""" * return PyDataType_FLAGS(self) # <<<<<<<<<<<<<< @@ -17295,7 +17277,7 @@ static CYTHON_INLINE npy_uint64 __pyx_f_5numpy_5dtype_5flags_flags(PyArray_Descr __pyx_r = PyDataType_FLAGS(__pyx_v_self); goto __pyx_L0; - /* "../../../../../tmp/pip-build-env-_q1myxj8/overlay/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":310 + /* "../../../../../tmp/pip-build-env-4954wg_r/overlay/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":268 * return PyDataType_SUBARRAY(self) * * @property # <<<<<<<<<<<<<< @@ -17308,7 +17290,7 @@ static CYTHON_INLINE npy_uint64 __pyx_f_5numpy_5dtype_5flags_flags(PyArray_Descr return __pyx_r; } -/* "../../../../../tmp/pip-build-env-_q1myxj8/overlay/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":322 +/* "../../../../../tmp/pip-build-env-4954wg_r/overlay/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":280 * ctypedef class numpy.broadcast [object PyArrayMultiIterObject, check_size ignore]: * * @property # <<<<<<<<<<<<<< @@ -17319,7 +17301,7 @@ static CYTHON_INLINE npy_uint64 __pyx_f_5numpy_5dtype_5flags_flags(PyArray_Descr static CYTHON_INLINE int __pyx_f_5numpy_9broadcast_7numiter_numiter(PyArrayMultiIterObject *__pyx_v_self) { int __pyx_r; - /* "../../../../../tmp/pip-build-env-_q1myxj8/overlay/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":325 + /* "../../../../../tmp/pip-build-env-4954wg_r/overlay/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":283 * cdef inline int numiter(self) noexcept nogil: * """The number of arrays that need to be broadcast to the same shape.""" * return PyArray_MultiIter_NUMITER(self) # <<<<<<<<<<<<<< @@ -17329,7 +17311,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_9broadcast_7numiter_numiter(PyArrayMulti __pyx_r = PyArray_MultiIter_NUMITER(__pyx_v_self); goto __pyx_L0; - /* "../../../../../tmp/pip-build-env-_q1myxj8/overlay/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":322 + /* "../../../../../tmp/pip-build-env-4954wg_r/overlay/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":280 * ctypedef class numpy.broadcast [object PyArrayMultiIterObject, check_size ignore]: * * @property # <<<<<<<<<<<<<< @@ -17342,7 +17324,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_9broadcast_7numiter_numiter(PyArrayMulti return __pyx_r; } -/* "../../../../../tmp/pip-build-env-_q1myxj8/overlay/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":327 +/* "../../../../../tmp/pip-build-env-4954wg_r/overlay/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":285 * return PyArray_MultiIter_NUMITER(self) * * @property # <<<<<<<<<<<<<< @@ -17353,7 +17335,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_9broadcast_7numiter_numiter(PyArrayMulti static CYTHON_INLINE npy_intp __pyx_f_5numpy_9broadcast_4size_size(PyArrayMultiIterObject *__pyx_v_self) { npy_intp __pyx_r; - /* "../../../../../tmp/pip-build-env-_q1myxj8/overlay/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":330 + /* "../../../../../tmp/pip-build-env-4954wg_r/overlay/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":288 * cdef inline npy_intp size(self) noexcept nogil: * """The total broadcasted size.""" * return PyArray_MultiIter_SIZE(self) # <<<<<<<<<<<<<< @@ -17363,7 +17345,7 @@ static CYTHON_INLINE npy_intp __pyx_f_5numpy_9broadcast_4size_size(PyArrayMultiI __pyx_r = PyArray_MultiIter_SIZE(__pyx_v_self); goto __pyx_L0; - /* "../../../../../tmp/pip-build-env-_q1myxj8/overlay/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":327 + /* "../../../../../tmp/pip-build-env-4954wg_r/overlay/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":285 * return PyArray_MultiIter_NUMITER(self) * * @property # <<<<<<<<<<<<<< @@ -17376,7 +17358,7 @@ static CYTHON_INLINE npy_intp __pyx_f_5numpy_9broadcast_4size_size(PyArrayMultiI return __pyx_r; } -/* "../../../../../tmp/pip-build-env-_q1myxj8/overlay/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":332 +/* "../../../../../tmp/pip-build-env-4954wg_r/overlay/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":290 * return PyArray_MultiIter_SIZE(self) * * @property # <<<<<<<<<<<<<< @@ -17387,7 +17369,7 @@ static CYTHON_INLINE npy_intp __pyx_f_5numpy_9broadcast_4size_size(PyArrayMultiI static CYTHON_INLINE npy_intp __pyx_f_5numpy_9broadcast_5index_index(PyArrayMultiIterObject *__pyx_v_self) { npy_intp __pyx_r; - /* "../../../../../tmp/pip-build-env-_q1myxj8/overlay/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":335 + /* "../../../../../tmp/pip-build-env-4954wg_r/overlay/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":293 * cdef inline npy_intp index(self) noexcept nogil: * """The current (1-d) index into the broadcasted result.""" * return PyArray_MultiIter_INDEX(self) # <<<<<<<<<<<<<< @@ -17397,7 +17379,7 @@ static CYTHON_INLINE npy_intp __pyx_f_5numpy_9broadcast_5index_index(PyArrayMult __pyx_r = PyArray_MultiIter_INDEX(__pyx_v_self); goto __pyx_L0; - /* "../../../../../tmp/pip-build-env-_q1myxj8/overlay/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":332 + /* "../../../../../tmp/pip-build-env-4954wg_r/overlay/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":290 * return PyArray_MultiIter_SIZE(self) * * @property # <<<<<<<<<<<<<< @@ -17410,7 +17392,7 @@ static CYTHON_INLINE npy_intp __pyx_f_5numpy_9broadcast_5index_index(PyArrayMult return __pyx_r; } -/* "../../../../../tmp/pip-build-env-_q1myxj8/overlay/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":337 +/* "../../../../../tmp/pip-build-env-4954wg_r/overlay/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":295 * return PyArray_MultiIter_INDEX(self) * * @property # <<<<<<<<<<<<<< @@ -17421,7 +17403,7 @@ static CYTHON_INLINE npy_intp __pyx_f_5numpy_9broadcast_5index_index(PyArrayMult static CYTHON_INLINE int __pyx_f_5numpy_9broadcast_2nd_nd(PyArrayMultiIterObject *__pyx_v_self) { int __pyx_r; - /* "../../../../../tmp/pip-build-env-_q1myxj8/overlay/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":340 + /* "../../../../../tmp/pip-build-env-4954wg_r/overlay/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":298 * cdef inline int nd(self) noexcept nogil: * """The number of dimensions in the broadcasted result.""" * return PyArray_MultiIter_NDIM(self) # <<<<<<<<<<<<<< @@ -17431,7 +17413,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_9broadcast_2nd_nd(PyArrayMultiIterObject __pyx_r = PyArray_MultiIter_NDIM(__pyx_v_self); goto __pyx_L0; - /* "../../../../../tmp/pip-build-env-_q1myxj8/overlay/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":337 + /* "../../../../../tmp/pip-build-env-4954wg_r/overlay/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":295 * return PyArray_MultiIter_INDEX(self) * * @property # <<<<<<<<<<<<<< @@ -17444,7 +17426,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_9broadcast_2nd_nd(PyArrayMultiIterObject return __pyx_r; } -/* "../../../../../tmp/pip-build-env-_q1myxj8/overlay/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":342 +/* "../../../../../tmp/pip-build-env-4954wg_r/overlay/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":300 * return PyArray_MultiIter_NDIM(self) * * @property # <<<<<<<<<<<<<< @@ -17455,7 +17437,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_9broadcast_2nd_nd(PyArrayMultiIterObject static CYTHON_INLINE npy_intp *__pyx_f_5numpy_9broadcast_10dimensions_dimensions(PyArrayMultiIterObject *__pyx_v_self) { npy_intp *__pyx_r; - /* "../../../../../tmp/pip-build-env-_q1myxj8/overlay/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":345 + /* "../../../../../tmp/pip-build-env-4954wg_r/overlay/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":303 * cdef inline npy_intp* dimensions(self) noexcept nogil: * """The shape of the broadcasted result.""" * return PyArray_MultiIter_DIMS(self) # <<<<<<<<<<<<<< @@ -17465,7 +17447,7 @@ static CYTHON_INLINE npy_intp *__pyx_f_5numpy_9broadcast_10dimensions_dimensions __pyx_r = PyArray_MultiIter_DIMS(__pyx_v_self); goto __pyx_L0; - /* "../../../../../tmp/pip-build-env-_q1myxj8/overlay/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":342 + /* "../../../../../tmp/pip-build-env-4954wg_r/overlay/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":300 * return PyArray_MultiIter_NDIM(self) * * @property # <<<<<<<<<<<<<< @@ -17478,7 +17460,7 @@ static CYTHON_INLINE npy_intp *__pyx_f_5numpy_9broadcast_10dimensions_dimensions return __pyx_r; } -/* "../../../../../tmp/pip-build-env-_q1myxj8/overlay/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":347 +/* "../../../../../tmp/pip-build-env-4954wg_r/overlay/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":305 * return PyArray_MultiIter_DIMS(self) * * @property # <<<<<<<<<<<<<< @@ -17489,7 +17471,7 @@ static CYTHON_INLINE npy_intp *__pyx_f_5numpy_9broadcast_10dimensions_dimensions static CYTHON_INLINE void **__pyx_f_5numpy_9broadcast_5iters_iters(PyArrayMultiIterObject *__pyx_v_self) { void **__pyx_r; - /* "../../../../../tmp/pip-build-env-_q1myxj8/overlay/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":351 + /* "../../../../../tmp/pip-build-env-4954wg_r/overlay/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":309 * """An array of iterator objects that holds the iterators for the arrays to be broadcast together. * On return, the iterators are adjusted for broadcasting.""" * return PyArray_MultiIter_ITERS(self) # <<<<<<<<<<<<<< @@ -17499,7 +17481,7 @@ static CYTHON_INLINE void **__pyx_f_5numpy_9broadcast_5iters_iters(PyArrayMultiI __pyx_r = PyArray_MultiIter_ITERS(__pyx_v_self); goto __pyx_L0; - /* "../../../../../tmp/pip-build-env-_q1myxj8/overlay/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":347 + /* "../../../../../tmp/pip-build-env-4954wg_r/overlay/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":305 * return PyArray_MultiIter_DIMS(self) * * @property # <<<<<<<<<<<<<< @@ -17512,7 +17494,7 @@ static CYTHON_INLINE void **__pyx_f_5numpy_9broadcast_5iters_iters(PyArrayMultiI return __pyx_r; } -/* "../../../../../tmp/pip-build-env-_q1myxj8/overlay/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":365 +/* "../../../../../tmp/pip-build-env-4954wg_r/overlay/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":323 * # Instead, we use properties that map to the corresponding C-API functions. * * @property # <<<<<<<<<<<<<< @@ -17523,7 +17505,7 @@ static CYTHON_INLINE void **__pyx_f_5numpy_9broadcast_5iters_iters(PyArrayMultiI static CYTHON_INLINE PyObject *__pyx_f_5numpy_7ndarray_4base_base(PyArrayObject *__pyx_v_self) { PyObject *__pyx_r; - /* "../../../../../tmp/pip-build-env-_q1myxj8/overlay/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":369 + /* "../../../../../tmp/pip-build-env-4954wg_r/overlay/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":327 * """Returns a borrowed reference to the object owning the data/memory. * """ * return PyArray_BASE(self) # <<<<<<<<<<<<<< @@ -17533,7 +17515,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_7ndarray_4base_base(PyArrayObject __pyx_r = PyArray_BASE(__pyx_v_self); goto __pyx_L0; - /* "../../../../../tmp/pip-build-env-_q1myxj8/overlay/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":365 + /* "../../../../../tmp/pip-build-env-4954wg_r/overlay/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":323 * # Instead, we use properties that map to the corresponding C-API functions. * * @property # <<<<<<<<<<<<<< @@ -17546,7 +17528,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_7ndarray_4base_base(PyArrayObject return __pyx_r; } -/* "../../../../../tmp/pip-build-env-_q1myxj8/overlay/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":371 +/* "../../../../../tmp/pip-build-env-4954wg_r/overlay/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":329 * return PyArray_BASE(self) * * @property # <<<<<<<<<<<<<< @@ -17560,7 +17542,7 @@ static CYTHON_INLINE PyArray_Descr *__pyx_f_5numpy_7ndarray_5descr_descr(PyArray PyArray_Descr *__pyx_t_1; __Pyx_RefNannySetupContext("descr", 0); - /* "../../../../../tmp/pip-build-env-_q1myxj8/overlay/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":375 + /* "../../../../../tmp/pip-build-env-4954wg_r/overlay/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":333 * """Returns an owned reference to the dtype of the array. * """ * return PyArray_DESCR(self) # <<<<<<<<<<<<<< @@ -17573,7 +17555,7 @@ static CYTHON_INLINE PyArray_Descr *__pyx_f_5numpy_7ndarray_5descr_descr(PyArray __pyx_r = ((PyArray_Descr *)__pyx_t_1); goto __pyx_L0; - /* "../../../../../tmp/pip-build-env-_q1myxj8/overlay/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":371 + /* "../../../../../tmp/pip-build-env-4954wg_r/overlay/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":329 * return PyArray_BASE(self) * * @property # <<<<<<<<<<<<<< @@ -17588,7 +17570,7 @@ static CYTHON_INLINE PyArray_Descr *__pyx_f_5numpy_7ndarray_5descr_descr(PyArray return __pyx_r; } -/* "../../../../../tmp/pip-build-env-_q1myxj8/overlay/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":377 +/* "../../../../../tmp/pip-build-env-4954wg_r/overlay/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":335 * return PyArray_DESCR(self) * * @property # <<<<<<<<<<<<<< @@ -17599,7 +17581,7 @@ static CYTHON_INLINE PyArray_Descr *__pyx_f_5numpy_7ndarray_5descr_descr(PyArray static CYTHON_INLINE int __pyx_f_5numpy_7ndarray_4ndim_ndim(PyArrayObject *__pyx_v_self) { int __pyx_r; - /* "../../../../../tmp/pip-build-env-_q1myxj8/overlay/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":381 + /* "../../../../../tmp/pip-build-env-4954wg_r/overlay/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":339 * """Returns the number of dimensions in the array. * """ * return PyArray_NDIM(self) # <<<<<<<<<<<<<< @@ -17609,7 +17591,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_7ndarray_4ndim_ndim(PyArrayObject *__pyx __pyx_r = PyArray_NDIM(__pyx_v_self); goto __pyx_L0; - /* "../../../../../tmp/pip-build-env-_q1myxj8/overlay/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":377 + /* "../../../../../tmp/pip-build-env-4954wg_r/overlay/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":335 * return PyArray_DESCR(self) * * @property # <<<<<<<<<<<<<< @@ -17622,7 +17604,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_7ndarray_4ndim_ndim(PyArrayObject *__pyx return __pyx_r; } -/* "../../../../../tmp/pip-build-env-_q1myxj8/overlay/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":383 +/* "../../../../../tmp/pip-build-env-4954wg_r/overlay/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":341 * return PyArray_NDIM(self) * * @property # <<<<<<<<<<<<<< @@ -17633,7 +17615,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_7ndarray_4ndim_ndim(PyArrayObject *__pyx static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_5shape_shape(PyArrayObject *__pyx_v_self) { npy_intp *__pyx_r; - /* "../../../../../tmp/pip-build-env-_q1myxj8/overlay/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":389 + /* "../../../../../tmp/pip-build-env-4954wg_r/overlay/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":347 * Can return NULL for 0-dimensional arrays. * """ * return PyArray_DIMS(self) # <<<<<<<<<<<<<< @@ -17643,7 +17625,7 @@ static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_5shape_shape(PyArrayObjec __pyx_r = PyArray_DIMS(__pyx_v_self); goto __pyx_L0; - /* "../../../../../tmp/pip-build-env-_q1myxj8/overlay/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":383 + /* "../../../../../tmp/pip-build-env-4954wg_r/overlay/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":341 * return PyArray_NDIM(self) * * @property # <<<<<<<<<<<<<< @@ -17656,7 +17638,7 @@ static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_5shape_shape(PyArrayObjec return __pyx_r; } -/* "../../../../../tmp/pip-build-env-_q1myxj8/overlay/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":391 +/* "../../../../../tmp/pip-build-env-4954wg_r/overlay/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":349 * return PyArray_DIMS(self) * * @property # <<<<<<<<<<<<<< @@ -17667,7 +17649,7 @@ static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_5shape_shape(PyArrayObjec static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_7strides_strides(PyArrayObject *__pyx_v_self) { npy_intp *__pyx_r; - /* "../../../../../tmp/pip-build-env-_q1myxj8/overlay/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":396 + /* "../../../../../tmp/pip-build-env-4954wg_r/overlay/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":354 * The number of elements matches the number of dimensions of the array (ndim). * """ * return PyArray_STRIDES(self) # <<<<<<<<<<<<<< @@ -17677,7 +17659,7 @@ static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_7strides_strides(PyArrayO __pyx_r = PyArray_STRIDES(__pyx_v_self); goto __pyx_L0; - /* "../../../../../tmp/pip-build-env-_q1myxj8/overlay/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":391 + /* "../../../../../tmp/pip-build-env-4954wg_r/overlay/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":349 * return PyArray_DIMS(self) * * @property # <<<<<<<<<<<<<< @@ -17690,7 +17672,7 @@ static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_7strides_strides(PyArrayO return __pyx_r; } -/* "../../../../../tmp/pip-build-env-_q1myxj8/overlay/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":398 +/* "../../../../../tmp/pip-build-env-4954wg_r/overlay/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":356 * return PyArray_STRIDES(self) * * @property # <<<<<<<<<<<<<< @@ -17701,7 +17683,7 @@ static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_7strides_strides(PyArrayO static CYTHON_INLINE npy_intp __pyx_f_5numpy_7ndarray_4size_size(PyArrayObject *__pyx_v_self) { npy_intp __pyx_r; - /* "../../../../../tmp/pip-build-env-_q1myxj8/overlay/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":402 + /* "../../../../../tmp/pip-build-env-4954wg_r/overlay/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":360 * """Returns the total size (in number of elements) of the array. * """ * return PyArray_SIZE(self) # <<<<<<<<<<<<<< @@ -17711,7 +17693,7 @@ static CYTHON_INLINE npy_intp __pyx_f_5numpy_7ndarray_4size_size(PyArrayObject * __pyx_r = PyArray_SIZE(__pyx_v_self); goto __pyx_L0; - /* "../../../../../tmp/pip-build-env-_q1myxj8/overlay/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":398 + /* "../../../../../tmp/pip-build-env-4954wg_r/overlay/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":356 * return PyArray_STRIDES(self) * * @property # <<<<<<<<<<<<<< @@ -17724,7 +17706,7 @@ static CYTHON_INLINE npy_intp __pyx_f_5numpy_7ndarray_4size_size(PyArrayObject * return __pyx_r; } -/* "../../../../../tmp/pip-build-env-_q1myxj8/overlay/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":404 +/* "../../../../../tmp/pip-build-env-4954wg_r/overlay/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":362 * return PyArray_SIZE(self) * * @property # <<<<<<<<<<<<<< @@ -17735,7 +17717,7 @@ static CYTHON_INLINE npy_intp __pyx_f_5numpy_7ndarray_4size_size(PyArrayObject * static CYTHON_INLINE char *__pyx_f_5numpy_7ndarray_4data_data(PyArrayObject *__pyx_v_self) { char *__pyx_r; - /* "../../../../../tmp/pip-build-env-_q1myxj8/overlay/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":411 + /* "../../../../../tmp/pip-build-env-4954wg_r/overlay/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":369 * of `PyArray_DATA()` instead, which returns a 'void*'. * """ * return PyArray_BYTES(self) # <<<<<<<<<<<<<< @@ -17745,7 +17727,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy_7ndarray_4data_data(PyArrayObject *__p __pyx_r = PyArray_BYTES(__pyx_v_self); goto __pyx_L0; - /* "../../../../../tmp/pip-build-env-_q1myxj8/overlay/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":404 + /* "../../../../../tmp/pip-build-env-4954wg_r/overlay/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":362 * return PyArray_SIZE(self) * * @property # <<<<<<<<<<<<<< @@ -17758,7 +17740,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy_7ndarray_4data_data(PyArrayObject *__p return __pyx_r; } -/* "../../../../../tmp/pip-build-env-_q1myxj8/overlay/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":807 +/* "../../../../../tmp/pip-build-env-4954wg_r/overlay/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":777 * ctypedef long double complex clongdouble_t * * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< @@ -17775,7 +17757,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0); - /* "../../../../../tmp/pip-build-env-_q1myxj8/overlay/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":808 + /* "../../../../../tmp/pip-build-env-4954wg_r/overlay/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":778 * * cdef inline object PyArray_MultiIterNew1(a): * return PyArray_MultiIterNew(1, a) # <<<<<<<<<<<<<< @@ -17783,13 +17765,13 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__ * cdef inline object PyArray_MultiIterNew2(a, b): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 808, __pyx_L1_error) + __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 778, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "../../../../../tmp/pip-build-env-_q1myxj8/overlay/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":807 + /* "../../../../../tmp/pip-build-env-4954wg_r/overlay/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":777 * ctypedef long double complex clongdouble_t * * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< @@ -17808,7 +17790,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__ return __pyx_r; } -/* "../../../../../tmp/pip-build-env-_q1myxj8/overlay/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":810 +/* "../../../../../tmp/pip-build-env-4954wg_r/overlay/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":780 * return PyArray_MultiIterNew(1, a) * * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< @@ -17825,7 +17807,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0); - /* "../../../../../tmp/pip-build-env-_q1myxj8/overlay/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":811 + /* "../../../../../tmp/pip-build-env-4954wg_r/overlay/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":781 * * cdef inline object PyArray_MultiIterNew2(a, b): * return PyArray_MultiIterNew(2, a, b) # <<<<<<<<<<<<<< @@ -17833,13 +17815,13 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ * cdef inline object PyArray_MultiIterNew3(a, b, c): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 811, __pyx_L1_error) + __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 781, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "../../../../../tmp/pip-build-env-_q1myxj8/overlay/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":810 + /* "../../../../../tmp/pip-build-env-4954wg_r/overlay/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":780 * return PyArray_MultiIterNew(1, a) * * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< @@ -17858,7 +17840,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ return __pyx_r; } -/* "../../../../../tmp/pip-build-env-_q1myxj8/overlay/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":813 +/* "../../../../../tmp/pip-build-env-4954wg_r/overlay/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":783 * return PyArray_MultiIterNew(2, a, b) * * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< @@ -17875,7 +17857,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0); - /* "../../../../../tmp/pip-build-env-_q1myxj8/overlay/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":814 + /* "../../../../../tmp/pip-build-env-4954wg_r/overlay/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":784 * * cdef inline object PyArray_MultiIterNew3(a, b, c): * return PyArray_MultiIterNew(3, a, b, c) # <<<<<<<<<<<<<< @@ -17883,13 +17865,13 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ * cdef inline object PyArray_MultiIterNew4(a, b, c, d): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyArray_MultiIterNew(3, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 814, __pyx_L1_error) + __pyx_t_1 = PyArray_MultiIterNew(3, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 784, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "../../../../../tmp/pip-build-env-_q1myxj8/overlay/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":813 + /* "../../../../../tmp/pip-build-env-4954wg_r/overlay/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":783 * return PyArray_MultiIterNew(2, a, b) * * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< @@ -17908,7 +17890,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ return __pyx_r; } -/* "../../../../../tmp/pip-build-env-_q1myxj8/overlay/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":816 +/* "../../../../../tmp/pip-build-env-4954wg_r/overlay/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":786 * return PyArray_MultiIterNew(3, a, b, c) * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< @@ -17925,7 +17907,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0); - /* "../../../../../tmp/pip-build-env-_q1myxj8/overlay/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":817 + /* "../../../../../tmp/pip-build-env-4954wg_r/overlay/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":787 * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): * return PyArray_MultiIterNew(4, a, b, c, d) # <<<<<<<<<<<<<< @@ -17933,13 +17915,13 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyArray_MultiIterNew(4, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 817, __pyx_L1_error) + __pyx_t_1 = PyArray_MultiIterNew(4, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 787, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "../../../../../tmp/pip-build-env-_q1myxj8/overlay/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":816 + /* "../../../../../tmp/pip-build-env-4954wg_r/overlay/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":786 * return PyArray_MultiIterNew(3, a, b, c) * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< @@ -17958,7 +17940,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ return __pyx_r; } -/* "../../../../../tmp/pip-build-env-_q1myxj8/overlay/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":819 +/* "../../../../../tmp/pip-build-env-4954wg_r/overlay/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":789 * return PyArray_MultiIterNew(4, a, b, c, d) * * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< @@ -17975,7 +17957,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0); - /* "../../../../../tmp/pip-build-env-_q1myxj8/overlay/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":820 + /* "../../../../../tmp/pip-build-env-4954wg_r/overlay/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":790 * * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): * return PyArray_MultiIterNew(5, a, b, c, d, e) # <<<<<<<<<<<<<< @@ -17983,13 +17965,13 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ * cdef inline tuple PyDataType_SHAPE(dtype d): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 820, __pyx_L1_error) + __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 790, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "../../../../../tmp/pip-build-env-_q1myxj8/overlay/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":819 + /* "../../../../../tmp/pip-build-env-4954wg_r/overlay/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":789 * return PyArray_MultiIterNew(4, a, b, c, d) * * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< @@ -18008,7 +17990,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ return __pyx_r; } -/* "../../../../../tmp/pip-build-env-_q1myxj8/overlay/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":822 +/* "../../../../../tmp/pip-build-env-4954wg_r/overlay/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":792 * return PyArray_MultiIterNew(5, a, b, c, d, e) * * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<< @@ -18023,7 +18005,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ PyObject *__pyx_t_2; __Pyx_RefNannySetupContext("PyDataType_SHAPE", 0); - /* "../../../../../tmp/pip-build-env-_q1myxj8/overlay/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":823 + /* "../../../../../tmp/pip-build-env-4954wg_r/overlay/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":793 * * cdef inline tuple PyDataType_SHAPE(dtype d): * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<< @@ -18033,7 +18015,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ __pyx_t_1 = PyDataType_HASSUBARRAY(__pyx_v_d); if (__pyx_t_1) { - /* "../../../../../tmp/pip-build-env-_q1myxj8/overlay/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":824 + /* "../../../../../tmp/pip-build-env-4954wg_r/overlay/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":794 * cdef inline tuple PyDataType_SHAPE(dtype d): * if PyDataType_HASSUBARRAY(d): * return d.subarray.shape # <<<<<<<<<<<<<< @@ -18046,7 +18028,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ __pyx_r = ((PyObject*)__pyx_t_2); goto __pyx_L0; - /* "../../../../../tmp/pip-build-env-_q1myxj8/overlay/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":823 + /* "../../../../../tmp/pip-build-env-4954wg_r/overlay/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":793 * * cdef inline tuple PyDataType_SHAPE(dtype d): * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<< @@ -18055,7 +18037,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ */ } - /* "../../../../../tmp/pip-build-env-_q1myxj8/overlay/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":826 + /* "../../../../../tmp/pip-build-env-4954wg_r/overlay/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":796 * return d.subarray.shape * else: * return () # <<<<<<<<<<<<<< @@ -18069,7 +18051,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ goto __pyx_L0; } - /* "../../../../../tmp/pip-build-env-_q1myxj8/overlay/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":822 + /* "../../../../../tmp/pip-build-env-4954wg_r/overlay/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":792 * return PyArray_MultiIterNew(5, a, b, c, d, e) * * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<< @@ -18084,7 +18066,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ return __pyx_r; } -/* "../../../../../tmp/pip-build-env-_q1myxj8/overlay/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1010 +/* "../../../../../tmp/pip-build-env-4954wg_r/overlay/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":995 * int _import_umath() except -1 * * cdef inline void set_array_base(ndarray arr, object base) except *: # <<<<<<<<<<<<<< @@ -18098,7 +18080,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a const char *__pyx_filename = NULL; int __pyx_clineno = 0; - /* "../../../../../tmp/pip-build-env-_q1myxj8/overlay/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1011 + /* "../../../../../tmp/pip-build-env-4954wg_r/overlay/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":996 * * cdef inline void set_array_base(ndarray arr, object base) except *: * Py_INCREF(base) # important to do this before stealing the reference below! # <<<<<<<<<<<<<< @@ -18107,16 +18089,16 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a */ Py_INCREF(__pyx_v_base); - /* "../../../../../tmp/pip-build-env-_q1myxj8/overlay/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1012 + /* "../../../../../tmp/pip-build-env-4954wg_r/overlay/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":997 * cdef inline void set_array_base(ndarray arr, object base) except *: * Py_INCREF(base) # important to do this before stealing the reference below! * PyArray_SetBaseObject(arr, base) # <<<<<<<<<<<<<< * * cdef inline object get_array_base(ndarray arr): */ - __pyx_t_1 = PyArray_SetBaseObject(__pyx_v_arr, __pyx_v_base); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(2, 1012, __pyx_L1_error) + __pyx_t_1 = PyArray_SetBaseObject(__pyx_v_arr, __pyx_v_base); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(2, 997, __pyx_L1_error) - /* "../../../../../tmp/pip-build-env-_q1myxj8/overlay/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1010 + /* "../../../../../tmp/pip-build-env-4954wg_r/overlay/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":995 * int _import_umath() except -1 * * cdef inline void set_array_base(ndarray arr, object base) except *: # <<<<<<<<<<<<<< @@ -18131,7 +18113,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a __pyx_L0:; } -/* "../../../../../tmp/pip-build-env-_q1myxj8/overlay/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1014 +/* "../../../../../tmp/pip-build-env-4954wg_r/overlay/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":999 * PyArray_SetBaseObject(arr, base) * * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< @@ -18146,7 +18128,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py int __pyx_t_1; __Pyx_RefNannySetupContext("get_array_base", 0); - /* "../../../../../tmp/pip-build-env-_q1myxj8/overlay/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1015 + /* "../../../../../tmp/pip-build-env-4954wg_r/overlay/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":1000 * * cdef inline object get_array_base(ndarray arr): * base = PyArray_BASE(arr) # <<<<<<<<<<<<<< @@ -18155,7 +18137,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py */ __pyx_v_base = PyArray_BASE(__pyx_v_arr); - /* "../../../../../tmp/pip-build-env-_q1myxj8/overlay/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1016 + /* "../../../../../tmp/pip-build-env-4954wg_r/overlay/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":1001 * cdef inline object get_array_base(ndarray arr): * base = PyArray_BASE(arr) * if base is NULL: # <<<<<<<<<<<<<< @@ -18165,7 +18147,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py __pyx_t_1 = (__pyx_v_base == NULL); if (__pyx_t_1) { - /* "../../../../../tmp/pip-build-env-_q1myxj8/overlay/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1017 + /* "../../../../../tmp/pip-build-env-4954wg_r/overlay/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":1002 * base = PyArray_BASE(arr) * if base is NULL: * return None # <<<<<<<<<<<<<< @@ -18176,7 +18158,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; - /* "../../../../../tmp/pip-build-env-_q1myxj8/overlay/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1016 + /* "../../../../../tmp/pip-build-env-4954wg_r/overlay/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":1001 * cdef inline object get_array_base(ndarray arr): * base = PyArray_BASE(arr) * if base is NULL: # <<<<<<<<<<<<<< @@ -18185,7 +18167,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py */ } - /* "../../../../../tmp/pip-build-env-_q1myxj8/overlay/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1018 + /* "../../../../../tmp/pip-build-env-4954wg_r/overlay/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":1003 * if base is NULL: * return None * return base # <<<<<<<<<<<<<< @@ -18197,7 +18179,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py __pyx_r = ((PyObject *)__pyx_v_base); goto __pyx_L0; - /* "../../../../../tmp/pip-build-env-_q1myxj8/overlay/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1014 + /* "../../../../../tmp/pip-build-env-4954wg_r/overlay/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":999 * PyArray_SetBaseObject(arr, base) * * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< @@ -18212,7 +18194,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py return __pyx_r; } -/* "../../../../../tmp/pip-build-env-_q1myxj8/overlay/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1022 +/* "../../../../../tmp/pip-build-env-4954wg_r/overlay/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":1007 * # Versions of the import_* functions which are more suitable for * # Cython code. * cdef inline int import_array() except -1: # <<<<<<<<<<<<<< @@ -18238,7 +18220,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { int __pyx_clineno = 0; __Pyx_RefNannySetupContext("import_array", 0); - /* "../../../../../tmp/pip-build-env-_q1myxj8/overlay/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1023 + /* "../../../../../tmp/pip-build-env-4954wg_r/overlay/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":1008 * # Cython code. * cdef inline int import_array() except -1: * try: # <<<<<<<<<<<<<< @@ -18254,16 +18236,16 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { - /* "../../../../../tmp/pip-build-env-_q1myxj8/overlay/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1024 + /* "../../../../../tmp/pip-build-env-4954wg_r/overlay/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":1009 * cdef inline int import_array() except -1: * try: * __pyx_import_array() # <<<<<<<<<<<<<< * except Exception: * raise ImportError("numpy._core.multiarray failed to import") */ - __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 1024, __pyx_L3_error) + __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 1009, __pyx_L3_error) - /* "../../../../../tmp/pip-build-env-_q1myxj8/overlay/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1023 + /* "../../../../../tmp/pip-build-env-4954wg_r/overlay/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":1008 * # Cython code. * cdef inline int import_array() except -1: * try: # <<<<<<<<<<<<<< @@ -18277,7 +18259,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { goto __pyx_L8_try_end; __pyx_L3_error:; - /* "../../../../../tmp/pip-build-env-_q1myxj8/overlay/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1025 + /* "../../../../../tmp/pip-build-env-4954wg_r/overlay/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":1010 * try: * __pyx_import_array() * except Exception: # <<<<<<<<<<<<<< @@ -18287,12 +18269,12 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_Exception)))); if (__pyx_t_4) { __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 1025, __pyx_L5_except_error) + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 1010, __pyx_L5_except_error) __Pyx_XGOTREF(__pyx_t_5); __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_7); - /* "../../../../../tmp/pip-build-env-_q1myxj8/overlay/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1026 + /* "../../../../../tmp/pip-build-env-4954wg_r/overlay/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":1011 * __pyx_import_array() * except Exception: * raise ImportError("numpy._core.multiarray failed to import") # <<<<<<<<<<<<<< @@ -18305,16 +18287,16 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_mstate_global->__pyx_kp_u_numpy__core_multiarray_failed_to}; __pyx_t_8 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ImportError)), __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1026, __pyx_L5_except_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1011, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_8); } __Pyx_Raise(__pyx_t_8, 0, 0, 0); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __PYX_ERR(2, 1026, __pyx_L5_except_error) + __PYX_ERR(2, 1011, __pyx_L5_except_error) } goto __pyx_L5_except_error; - /* "../../../../../tmp/pip-build-env-_q1myxj8/overlay/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1023 + /* "../../../../../tmp/pip-build-env-4954wg_r/overlay/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":1008 * # Cython code. * cdef inline int import_array() except -1: * try: # <<<<<<<<<<<<<< @@ -18330,7 +18312,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { __pyx_L8_try_end:; } - /* "../../../../../tmp/pip-build-env-_q1myxj8/overlay/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1022 + /* "../../../../../tmp/pip-build-env-4954wg_r/overlay/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":1007 * # Versions of the import_* functions which are more suitable for * # Cython code. * cdef inline int import_array() except -1: # <<<<<<<<<<<<<< @@ -18354,7 +18336,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { return __pyx_r; } -/* "../../../../../tmp/pip-build-env-_q1myxj8/overlay/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1028 +/* "../../../../../tmp/pip-build-env-4954wg_r/overlay/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":1013 * raise ImportError("numpy._core.multiarray failed to import") * * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< @@ -18380,7 +18362,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { int __pyx_clineno = 0; __Pyx_RefNannySetupContext("import_umath", 0); - /* "../../../../../tmp/pip-build-env-_q1myxj8/overlay/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1029 + /* "../../../../../tmp/pip-build-env-4954wg_r/overlay/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":1014 * * cdef inline int import_umath() except -1: * try: # <<<<<<<<<<<<<< @@ -18396,16 +18378,16 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { - /* "../../../../../tmp/pip-build-env-_q1myxj8/overlay/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1030 + /* "../../../../../tmp/pip-build-env-4954wg_r/overlay/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":1015 * cdef inline int import_umath() except -1: * try: * _import_umath() # <<<<<<<<<<<<<< * except Exception: * raise ImportError("numpy._core.umath failed to import") */ - __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 1030, __pyx_L3_error) + __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 1015, __pyx_L3_error) - /* "../../../../../tmp/pip-build-env-_q1myxj8/overlay/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1029 + /* "../../../../../tmp/pip-build-env-4954wg_r/overlay/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":1014 * * cdef inline int import_umath() except -1: * try: # <<<<<<<<<<<<<< @@ -18419,7 +18401,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { goto __pyx_L8_try_end; __pyx_L3_error:; - /* "../../../../../tmp/pip-build-env-_q1myxj8/overlay/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1031 + /* "../../../../../tmp/pip-build-env-4954wg_r/overlay/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":1016 * try: * _import_umath() * except Exception: # <<<<<<<<<<<<<< @@ -18429,12 +18411,12 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_Exception)))); if (__pyx_t_4) { __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 1031, __pyx_L5_except_error) + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 1016, __pyx_L5_except_error) __Pyx_XGOTREF(__pyx_t_5); __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_7); - /* "../../../../../tmp/pip-build-env-_q1myxj8/overlay/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1032 + /* "../../../../../tmp/pip-build-env-4954wg_r/overlay/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":1017 * _import_umath() * except Exception: * raise ImportError("numpy._core.umath failed to import") # <<<<<<<<<<<<<< @@ -18447,16 +18429,16 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_mstate_global->__pyx_kp_u_numpy__core_umath_failed_to_impo}; __pyx_t_8 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ImportError)), __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1032, __pyx_L5_except_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1017, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_8); } __Pyx_Raise(__pyx_t_8, 0, 0, 0); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __PYX_ERR(2, 1032, __pyx_L5_except_error) + __PYX_ERR(2, 1017, __pyx_L5_except_error) } goto __pyx_L5_except_error; - /* "../../../../../tmp/pip-build-env-_q1myxj8/overlay/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1029 + /* "../../../../../tmp/pip-build-env-4954wg_r/overlay/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":1014 * * cdef inline int import_umath() except -1: * try: # <<<<<<<<<<<<<< @@ -18472,7 +18454,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { __pyx_L8_try_end:; } - /* "../../../../../tmp/pip-build-env-_q1myxj8/overlay/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1028 + /* "../../../../../tmp/pip-build-env-4954wg_r/overlay/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":1013 * raise ImportError("numpy._core.multiarray failed to import") * * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< @@ -18496,7 +18478,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { return __pyx_r; } -/* "../../../../../tmp/pip-build-env-_q1myxj8/overlay/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1034 +/* "../../../../../tmp/pip-build-env-4954wg_r/overlay/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":1019 * raise ImportError("numpy._core.umath failed to import") * * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< @@ -18522,7 +18504,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { int __pyx_clineno = 0; __Pyx_RefNannySetupContext("import_ufunc", 0); - /* "../../../../../tmp/pip-build-env-_q1myxj8/overlay/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1035 + /* "../../../../../tmp/pip-build-env-4954wg_r/overlay/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":1020 * * cdef inline int import_ufunc() except -1: * try: # <<<<<<<<<<<<<< @@ -18538,16 +18520,16 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { - /* "../../../../../tmp/pip-build-env-_q1myxj8/overlay/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1036 + /* "../../../../../tmp/pip-build-env-4954wg_r/overlay/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":1021 * cdef inline int import_ufunc() except -1: * try: * _import_umath() # <<<<<<<<<<<<<< * except Exception: * raise ImportError("numpy._core.umath failed to import") */ - __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 1036, __pyx_L3_error) + __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 1021, __pyx_L3_error) - /* "../../../../../tmp/pip-build-env-_q1myxj8/overlay/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1035 + /* "../../../../../tmp/pip-build-env-4954wg_r/overlay/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":1020 * * cdef inline int import_ufunc() except -1: * try: # <<<<<<<<<<<<<< @@ -18561,7 +18543,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { goto __pyx_L8_try_end; __pyx_L3_error:; - /* "../../../../../tmp/pip-build-env-_q1myxj8/overlay/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1037 + /* "../../../../../tmp/pip-build-env-4954wg_r/overlay/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":1022 * try: * _import_umath() * except Exception: # <<<<<<<<<<<<<< @@ -18571,12 +18553,12 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_Exception)))); if (__pyx_t_4) { __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 1037, __pyx_L5_except_error) + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 1022, __pyx_L5_except_error) __Pyx_XGOTREF(__pyx_t_5); __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_7); - /* "../../../../../tmp/pip-build-env-_q1myxj8/overlay/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1038 + /* "../../../../../tmp/pip-build-env-4954wg_r/overlay/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":1023 * _import_umath() * except Exception: * raise ImportError("numpy._core.umath failed to import") # <<<<<<<<<<<<<< @@ -18589,16 +18571,16 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_mstate_global->__pyx_kp_u_numpy__core_umath_failed_to_impo}; __pyx_t_8 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ImportError)), __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1038, __pyx_L5_except_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1023, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_8); } __Pyx_Raise(__pyx_t_8, 0, 0, 0); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __PYX_ERR(2, 1038, __pyx_L5_except_error) + __PYX_ERR(2, 1023, __pyx_L5_except_error) } goto __pyx_L5_except_error; - /* "../../../../../tmp/pip-build-env-_q1myxj8/overlay/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1035 + /* "../../../../../tmp/pip-build-env-4954wg_r/overlay/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":1020 * * cdef inline int import_ufunc() except -1: * try: # <<<<<<<<<<<<<< @@ -18614,7 +18596,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { __pyx_L8_try_end:; } - /* "../../../../../tmp/pip-build-env-_q1myxj8/overlay/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1034 + /* "../../../../../tmp/pip-build-env-4954wg_r/overlay/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":1019 * raise ImportError("numpy._core.umath failed to import") * * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< @@ -18638,7 +18620,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { return __pyx_r; } -/* "../../../../../tmp/pip-build-env-_q1myxj8/overlay/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1041 +/* "../../../../../tmp/pip-build-env-4954wg_r/overlay/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":1026 * * * cdef inline bint is_timedelta64_object(object obj) noexcept: # <<<<<<<<<<<<<< @@ -18649,7 +18631,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { static CYTHON_INLINE int __pyx_f_5numpy_is_timedelta64_object(PyObject *__pyx_v_obj) { int __pyx_r; - /* "../../../../../tmp/pip-build-env-_q1myxj8/overlay/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1053 + /* "../../../../../tmp/pip-build-env-4954wg_r/overlay/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":1038 * bool * """ * return PyObject_TypeCheck(obj, &PyTimedeltaArrType_Type) # <<<<<<<<<<<<<< @@ -18659,7 +18641,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_is_timedelta64_object(PyObject *__pyx_v_ __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyTimedeltaArrType_Type)); goto __pyx_L0; - /* "../../../../../tmp/pip-build-env-_q1myxj8/overlay/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1041 + /* "../../../../../tmp/pip-build-env-4954wg_r/overlay/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":1026 * * * cdef inline bint is_timedelta64_object(object obj) noexcept: # <<<<<<<<<<<<<< @@ -18672,7 +18654,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_is_timedelta64_object(PyObject *__pyx_v_ return __pyx_r; } -/* "../../../../../tmp/pip-build-env-_q1myxj8/overlay/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1056 +/* "../../../../../tmp/pip-build-env-4954wg_r/overlay/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":1041 * * * cdef inline bint is_datetime64_object(object obj) noexcept: # <<<<<<<<<<<<<< @@ -18683,7 +18665,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_is_timedelta64_object(PyObject *__pyx_v_ static CYTHON_INLINE int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_obj) { int __pyx_r; - /* "../../../../../tmp/pip-build-env-_q1myxj8/overlay/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1068 + /* "../../../../../tmp/pip-build-env-4954wg_r/overlay/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":1053 * bool * """ * return PyObject_TypeCheck(obj, &PyDatetimeArrType_Type) # <<<<<<<<<<<<<< @@ -18693,7 +18675,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_o __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyDatetimeArrType_Type)); goto __pyx_L0; - /* "../../../../../tmp/pip-build-env-_q1myxj8/overlay/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1056 + /* "../../../../../tmp/pip-build-env-4954wg_r/overlay/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":1041 * * * cdef inline bint is_datetime64_object(object obj) noexcept: # <<<<<<<<<<<<<< @@ -18706,7 +18688,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_o return __pyx_r; } -/* "../../../../../tmp/pip-build-env-_q1myxj8/overlay/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1071 +/* "../../../../../tmp/pip-build-env-4954wg_r/overlay/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":1056 * * * cdef inline npy_datetime get_datetime64_value(object obj) noexcept nogil: # <<<<<<<<<<<<<< @@ -18717,7 +18699,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_o static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject *__pyx_v_obj) { npy_datetime __pyx_r; - /* "../../../../../tmp/pip-build-env-_q1myxj8/overlay/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1078 + /* "../../../../../tmp/pip-build-env-4954wg_r/overlay/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":1063 * also needed. That can be found using `get_datetime64_unit`. * """ * return (obj).obval # <<<<<<<<<<<<<< @@ -18727,7 +18709,7 @@ static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject * __pyx_r = ((PyDatetimeScalarObject *)__pyx_v_obj)->obval; goto __pyx_L0; - /* "../../../../../tmp/pip-build-env-_q1myxj8/overlay/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1071 + /* "../../../../../tmp/pip-build-env-4954wg_r/overlay/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":1056 * * * cdef inline npy_datetime get_datetime64_value(object obj) noexcept nogil: # <<<<<<<<<<<<<< @@ -18740,7 +18722,7 @@ static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject * return __pyx_r; } -/* "../../../../../tmp/pip-build-env-_q1myxj8/overlay/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1081 +/* "../../../../../tmp/pip-build-env-4954wg_r/overlay/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":1066 * * * cdef inline npy_timedelta get_timedelta64_value(object obj) noexcept nogil: # <<<<<<<<<<<<<< @@ -18751,7 +18733,7 @@ static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject * static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject *__pyx_v_obj) { npy_timedelta __pyx_r; - /* "../../../../../tmp/pip-build-env-_q1myxj8/overlay/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1085 + /* "../../../../../tmp/pip-build-env-4954wg_r/overlay/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":1070 * returns the int64 value underlying scalar numpy timedelta64 object * """ * return (obj).obval # <<<<<<<<<<<<<< @@ -18761,7 +18743,7 @@ static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject __pyx_r = ((PyTimedeltaScalarObject *)__pyx_v_obj)->obval; goto __pyx_L0; - /* "../../../../../tmp/pip-build-env-_q1myxj8/overlay/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1081 + /* "../../../../../tmp/pip-build-env-4954wg_r/overlay/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":1066 * * * cdef inline npy_timedelta get_timedelta64_value(object obj) noexcept nogil: # <<<<<<<<<<<<<< @@ -18774,7 +18756,7 @@ static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject return __pyx_r; } -/* "../../../../../tmp/pip-build-env-_q1myxj8/overlay/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1088 +/* "../../../../../tmp/pip-build-env-4954wg_r/overlay/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":1073 * * * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) noexcept nogil: # <<<<<<<<<<<<<< @@ -18785,7 +18767,7 @@ static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject static CYTHON_INLINE NPY_DATETIMEUNIT __pyx_f_5numpy_get_datetime64_unit(PyObject *__pyx_v_obj) { NPY_DATETIMEUNIT __pyx_r; - /* "../../../../../tmp/pip-build-env-_q1myxj8/overlay/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1092 + /* "../../../../../tmp/pip-build-env-4954wg_r/overlay/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":1077 * returns the unit part of the dtype for a numpy datetime64 object. * """ * return (obj).obmeta.base # <<<<<<<<<<<<<< @@ -18795,7 +18777,7 @@ static CYTHON_INLINE NPY_DATETIMEUNIT __pyx_f_5numpy_get_datetime64_unit(PyObjec __pyx_r = ((NPY_DATETIMEUNIT)((PyDatetimeScalarObject *)__pyx_v_obj)->obmeta.base); goto __pyx_L0; - /* "../../../../../tmp/pip-build-env-_q1myxj8/overlay/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1088 + /* "../../../../../tmp/pip-build-env-4954wg_r/overlay/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":1073 * * * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) noexcept nogil: # <<<<<<<<<<<<<< @@ -23598,7 +23580,7 @@ static int __Pyx_modinit_type_import_code(__pyx_mstatetype *__pyx_mstate) { #endif __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7cpython_4type_type) __PYX_ERR(3, 9, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyImport_ImportModule("numpy"); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 271, __pyx_L1_error) + __pyx_t_1 = PyImport_ImportModule("numpy"); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 229, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_mstate->__pyx_ptype_5numpy_dtype = __Pyx_ImportType_3_2_4(__pyx_t_1, "numpy", "dtype", #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000 @@ -23608,7 +23590,7 @@ static int __Pyx_modinit_type_import_code(__pyx_mstatetype *__pyx_mstate) { #else sizeof(PyArray_Descr), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(PyArray_Descr), #endif - __Pyx_ImportType_CheckSize_Ignore_3_2_4); if (!__pyx_mstate->__pyx_ptype_5numpy_dtype) __PYX_ERR(2, 271, __pyx_L1_error) + __Pyx_ImportType_CheckSize_Ignore_3_2_4); if (!__pyx_mstate->__pyx_ptype_5numpy_dtype) __PYX_ERR(2, 229, __pyx_L1_error) __pyx_mstate->__pyx_ptype_5numpy_flatiter = __Pyx_ImportType_3_2_4(__pyx_t_1, "numpy", "flatiter", #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000 sizeof(PyArrayIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(PyArrayIterObject), @@ -23617,7 +23599,7 @@ static int __Pyx_modinit_type_import_code(__pyx_mstatetype *__pyx_mstate) { #else sizeof(PyArrayIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(PyArrayIterObject), #endif - __Pyx_ImportType_CheckSize_Ignore_3_2_4); if (!__pyx_mstate->__pyx_ptype_5numpy_flatiter) __PYX_ERR(2, 316, __pyx_L1_error) + __Pyx_ImportType_CheckSize_Ignore_3_2_4); if (!__pyx_mstate->__pyx_ptype_5numpy_flatiter) __PYX_ERR(2, 274, __pyx_L1_error) __pyx_mstate->__pyx_ptype_5numpy_broadcast = __Pyx_ImportType_3_2_4(__pyx_t_1, "numpy", "broadcast", #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000 sizeof(PyArrayMultiIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(PyArrayMultiIterObject), @@ -23626,7 +23608,7 @@ static int __Pyx_modinit_type_import_code(__pyx_mstatetype *__pyx_mstate) { #else sizeof(PyArrayMultiIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(PyArrayMultiIterObject), #endif - __Pyx_ImportType_CheckSize_Ignore_3_2_4); if (!__pyx_mstate->__pyx_ptype_5numpy_broadcast) __PYX_ERR(2, 320, __pyx_L1_error) + __Pyx_ImportType_CheckSize_Ignore_3_2_4); if (!__pyx_mstate->__pyx_ptype_5numpy_broadcast) __PYX_ERR(2, 278, __pyx_L1_error) __pyx_mstate->__pyx_ptype_5numpy_ndarray = __Pyx_ImportType_3_2_4(__pyx_t_1, "numpy", "ndarray", #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000 sizeof(PyArrayObject), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(PyArrayObject), @@ -23635,7 +23617,7 @@ static int __Pyx_modinit_type_import_code(__pyx_mstatetype *__pyx_mstate) { #else sizeof(PyArrayObject), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(PyArrayObject), #endif - __Pyx_ImportType_CheckSize_Ignore_3_2_4); if (!__pyx_mstate->__pyx_ptype_5numpy_ndarray) __PYX_ERR(2, 359, __pyx_L1_error) + __Pyx_ImportType_CheckSize_Ignore_3_2_4); if (!__pyx_mstate->__pyx_ptype_5numpy_ndarray) __PYX_ERR(2, 317, __pyx_L1_error) __pyx_mstate->__pyx_ptype_5numpy_generic = __Pyx_ImportType_3_2_4(__pyx_t_1, "numpy", "generic", #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(PyObject), @@ -23644,7 +23626,7 @@ static int __Pyx_modinit_type_import_code(__pyx_mstatetype *__pyx_mstate) { #else sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(PyObject), #endif - __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_5numpy_generic) __PYX_ERR(2, 848, __pyx_L1_error) + __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_5numpy_generic) __PYX_ERR(2, 826, __pyx_L1_error) __pyx_mstate->__pyx_ptype_5numpy_number = __Pyx_ImportType_3_2_4(__pyx_t_1, "numpy", "number", #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(PyObject), @@ -23653,7 +23635,7 @@ static int __Pyx_modinit_type_import_code(__pyx_mstatetype *__pyx_mstate) { #else sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(PyObject), #endif - __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_5numpy_number) __PYX_ERR(2, 850, __pyx_L1_error) + __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_5numpy_number) __PYX_ERR(2, 828, __pyx_L1_error) __pyx_mstate->__pyx_ptype_5numpy_integer = __Pyx_ImportType_3_2_4(__pyx_t_1, "numpy", "integer", #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(PyObject), @@ -23662,7 +23644,7 @@ static int __Pyx_modinit_type_import_code(__pyx_mstatetype *__pyx_mstate) { #else sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(PyObject), #endif - __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_5numpy_integer) __PYX_ERR(2, 852, __pyx_L1_error) + __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_5numpy_integer) __PYX_ERR(2, 830, __pyx_L1_error) __pyx_mstate->__pyx_ptype_5numpy_signedinteger = __Pyx_ImportType_3_2_4(__pyx_t_1, "numpy", "signedinteger", #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(PyObject), @@ -23671,7 +23653,7 @@ static int __Pyx_modinit_type_import_code(__pyx_mstatetype *__pyx_mstate) { #else sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(PyObject), #endif - __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_5numpy_signedinteger) __PYX_ERR(2, 854, __pyx_L1_error) + __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_5numpy_signedinteger) __PYX_ERR(2, 832, __pyx_L1_error) __pyx_mstate->__pyx_ptype_5numpy_unsignedinteger = __Pyx_ImportType_3_2_4(__pyx_t_1, "numpy", "unsignedinteger", #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(PyObject), @@ -23680,7 +23662,7 @@ static int __Pyx_modinit_type_import_code(__pyx_mstatetype *__pyx_mstate) { #else sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(PyObject), #endif - __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_5numpy_unsignedinteger) __PYX_ERR(2, 856, __pyx_L1_error) + __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_5numpy_unsignedinteger) __PYX_ERR(2, 834, __pyx_L1_error) __pyx_mstate->__pyx_ptype_5numpy_inexact = __Pyx_ImportType_3_2_4(__pyx_t_1, "numpy", "inexact", #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(PyObject), @@ -23689,7 +23671,7 @@ static int __Pyx_modinit_type_import_code(__pyx_mstatetype *__pyx_mstate) { #else sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(PyObject), #endif - __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_5numpy_inexact) __PYX_ERR(2, 858, __pyx_L1_error) + __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_5numpy_inexact) __PYX_ERR(2, 836, __pyx_L1_error) __pyx_mstate->__pyx_ptype_5numpy_floating = __Pyx_ImportType_3_2_4(__pyx_t_1, "numpy", "floating", #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(PyObject), @@ -23698,7 +23680,7 @@ static int __Pyx_modinit_type_import_code(__pyx_mstatetype *__pyx_mstate) { #else sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(PyObject), #endif - __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_5numpy_floating) __PYX_ERR(2, 860, __pyx_L1_error) + __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_5numpy_floating) __PYX_ERR(2, 838, __pyx_L1_error) __pyx_mstate->__pyx_ptype_5numpy_complexfloating = __Pyx_ImportType_3_2_4(__pyx_t_1, "numpy", "complexfloating", #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(PyObject), @@ -23707,7 +23689,7 @@ static int __Pyx_modinit_type_import_code(__pyx_mstatetype *__pyx_mstate) { #else sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(PyObject), #endif - __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_5numpy_complexfloating) __PYX_ERR(2, 862, __pyx_L1_error) + __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_5numpy_complexfloating) __PYX_ERR(2, 840, __pyx_L1_error) __pyx_mstate->__pyx_ptype_5numpy_flexible = __Pyx_ImportType_3_2_4(__pyx_t_1, "numpy", "flexible", #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(PyObject), @@ -23716,7 +23698,7 @@ static int __Pyx_modinit_type_import_code(__pyx_mstatetype *__pyx_mstate) { #else sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(PyObject), #endif - __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_5numpy_flexible) __PYX_ERR(2, 864, __pyx_L1_error) + __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_5numpy_flexible) __PYX_ERR(2, 842, __pyx_L1_error) __pyx_mstate->__pyx_ptype_5numpy_character = __Pyx_ImportType_3_2_4(__pyx_t_1, "numpy", "character", #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(PyObject), @@ -23725,7 +23707,7 @@ static int __Pyx_modinit_type_import_code(__pyx_mstatetype *__pyx_mstate) { #else sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(PyObject), #endif - __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_5numpy_character) __PYX_ERR(2, 866, __pyx_L1_error) + __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_5numpy_character) __PYX_ERR(2, 844, __pyx_L1_error) __pyx_mstate->__pyx_ptype_5numpy_ufunc = __Pyx_ImportType_3_2_4(__pyx_t_1, "numpy", "ufunc", #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000 sizeof(PyUFuncObject), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(PyUFuncObject), @@ -23734,7 +23716,7 @@ static int __Pyx_modinit_type_import_code(__pyx_mstatetype *__pyx_mstate) { #else sizeof(PyUFuncObject), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(PyUFuncObject), #endif - __Pyx_ImportType_CheckSize_Ignore_3_2_4); if (!__pyx_mstate->__pyx_ptype_5numpy_ufunc) __PYX_ERR(2, 930, __pyx_L1_error) + __Pyx_ImportType_CheckSize_Ignore_3_2_4); if (!__pyx_mstate->__pyx_ptype_5numpy_ufunc) __PYX_ERR(2, 908, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_RefNannyFinishContext(); return 0; diff --git a/pyprophet/scoring/classifiers.py b/pyprophet/scoring/classifiers.py index 329b22a6..a97b6e10 100644 --- a/pyprophet/scoring/classifiers.py +++ b/pyprophet/scoring/classifiers.py @@ -84,7 +84,14 @@ class LinearLearner(AbstractLearner): def score(self, peaks, use_main_score): """Score the given peaks using the linear model.""" X = peaks.get_feature_matrix(use_main_score) - result = np.dot(X, self.get_parameters()).astype(np.float32) + # Ensure X is a proper numpy array (fixes pandas compatibility issues) + X = np.asarray(X, dtype=np.float32) + params = self.get_parameters() + if params is None: + raise ValueError("Model parameters not set. Call learn() first.") + # Ensure params is also a numpy array + params = np.asarray(params, dtype=np.float32) + result = np.dot(X, params).astype(np.float32) return result @classmethod @@ -169,7 +176,10 @@ def learn(self, decoy_peaks, target_peaks, use_main_score=True): def get_parameters(self): """Retrieve the scaling parameters of the LDA model.""" - return self.scalings + # Ensure parameters are always returned as a NumPy array (fixes sequence type error) + if self.scalings is None: + return None + return np.asarray(self.scalings, dtype=np.float32) def set_parameters(self, w): """Set the scaling parameters of the LDA model.""" @@ -287,9 +297,12 @@ def learn(self, decoy_peaks, target_peaks, use_main_score=True): def score(self, peaks, use_main_score): """Score the given peaks using the SVM model.""" X = peaks.get_feature_matrix(use_main_score) + # Ensure X is a proper numpy array (fixes pandas compatibility issues) + X = np.asarray(X, dtype=np.float32) # Check if self.classifier is loaded weights (an numpy.ndarray object) if isinstance(self.classifier, np.ndarray): - return np.dot(X, self.classifier).astype(np.float32) + classifier = np.asarray(self.classifier, dtype=np.float32) + return np.dot(X, classifier).astype(np.float32) elif isinstance(self.classifier, LinearSVC): return self.classifier.decision_function(X) @@ -528,6 +541,8 @@ def loss_gain_score(y_true, y_pred_proba, **kwargs): def score(self, peaks, use_main_score): """Score the given peaks using the HistGradientBoosting model.""" X = peaks.get_feature_matrix(use_main_score) + # Ensure X is a proper numpy array (fixes pandas compatibility issues) + X = np.asarray(X, dtype=np.float32) # Use decision_function for compatibility with XGBoost scoring result = self.classifier.decision_function(X) return result.astype(np.float32) @@ -709,6 +724,8 @@ def learn(self, decoy_peaks, target_peaks, use_main_score=True): def score(self, peaks, use_main_score): """Score the given peaks using the XGBoost model.""" X = peaks.get_feature_matrix(use_main_score) + # Ensure X is a proper numpy array (fixes pandas compatibility issues) + X = np.asarray(X, dtype=np.float32) dtest = xgb.DMatrix(X) result = self.classifier.predict(dtest) return result.astype(np.float32) diff --git a/pyprophet/scoring/runner.py b/pyprophet/scoring/runner.py index 18051c15..1f57a6a2 100644 --- a/pyprophet/scoring/runner.py +++ b/pyprophet/scoring/runner.py @@ -270,6 +270,8 @@ def run(self): logger.info("Total time: %d seconds and %d msecs wall time" % (seconds, msecs)) + if self.config.file_type == "osw": + return self.outfile if self.runner_config.classifier == "LDA": return self.config.extra_writes.get("trained_weights_path") elif self.runner_config.classifier == "SVM": @@ -372,7 +374,7 @@ def __init__(self, apply_weights: str, config: RunnerIOConfig): if not check_sqlite_table(con, "PYPROPHET_WEIGHTS"): raise click.ClickException( - "PYPROPHET_WEIGHTS table is not present in file, cannot apply weights for LDA classifier! Make sure you have run the scoring on a subset of the data first, or that you supplied the right `--classifier` parameter." + "PYPROPHET_WEIGHTS table is not present in file, cannot apply weights for %s classifier! Make sure you have run the scoring on a subset of the data first, or that you supplied the right `--classifier` parameter." % self.classifier ) data = pd.read_sql_query( "SELECT * FROM PYPROPHET_WEIGHTS WHERE LEVEL=='%s'" diff --git a/pyprophet/stats.py b/pyprophet/stats.py index 07285d67..a3a1f7a7 100644 --- a/pyprophet/stats.py +++ b/pyprophet/stats.py @@ -50,7 +50,10 @@ def to_one_dim_array(values, as_type=None): @profile def lookup_values_from_error_table(scores, err_df): """Find matching q-value for each score in 'scores'""" - ix = find_nearest_matches(np.float32(err_df.cutoff.values), np.float32(scores)) + # Ensure arrays are writable copies (fixes read-only buffer issue with numpy 1.26+) + cutoff_array = np.asarray(err_df.cutoff.values, dtype=np.float32).copy() + scores_array = np.asarray(scores, dtype=np.float32).copy() + ix = find_nearest_matches(cutoff_array, scores_array) return ( err_df.pvalue.iloc[ix].values, err_df.svalue.iloc[ix].values, diff --git a/tests/_regtest_outputs/test_pyprophet_score.test_multi_split_parquet_1.out b/tests/_regtest_outputs/test_pyprophet_score.test_multi_split_parquet_1.out index 6e30e1f4..d293d281 100644 --- a/tests/_regtest_outputs/test_pyprophet_score.test_multi_split_parquet_1.out +++ b/tests/_regtest_outputs/test_pyprophet_score.test_multi_split_parquet_1.out @@ -1,15 +1,15 @@ 96259 feature_id ms1_precursor_pep ms2_peakgroup_pep ms2_precursor_pep -0 -9078977811506172301 0.0005 9.9582e-08 0.1119 +0 -9078977811506172301 0.0005 9.9580e-08 0.1119 1 -9059007664292712863 1.0000 8.6993e-01 NaN -2 -9009602369958523731 0.0005 8.9398e-07 0.4155 -3 -8990894093332793487 0.0005 2.8346e-07 0.0409 -4 -8915955323477460297 0.0003 1.8926e-07 0.0181 +2 -9009602369958523731 0.0005 8.9400e-07 0.4155 +3 -8990894093332793487 0.0005 2.8350e-07 0.0409 +4 -8915955323477460297 0.0003 1.8930e-07 0.0181 .. ... ... ... ... -95 -4554654845515399609 0.0003 3.8685e-08 NaN +95 -4554654845515399609 0.0003 3.8680e-08 NaN 96 -4539808410625597778 0.0094 1.2626e-06 0.0352 -97 -4495976808403190115 0.0002 3.8685e-08 0.0378 -98 -4474179539802460946 0.0002 3.8685e-08 0.0157 -99 -4409520928686189639 0.0002 3.8685e-08 0.1650 +97 -4495976808403190115 0.0002 3.8680e-08 0.0378 +98 -4474179539802460946 0.0002 3.8680e-08 0.0157 +99 -4409520928686189639 0.0002 3.8680e-08 0.1650 [100 rows x 4 columns] diff --git a/tests/_regtest_outputs/test_pyprophet_score.test_osw_1.out b/tests/_regtest_outputs/test_pyprophet_score.test_osw_1.out index fb95eed9..1d1edfac 100644 --- a/tests/_regtest_outputs/test_pyprophet_score.test_osw_1.out +++ b/tests/_regtest_outputs/test_pyprophet_score.test_osw_1.out @@ -1,14 +1,14 @@ feature_id ms1_precursor_pep ms2_peakgroup_pep ms2_precursor_pep -0 -9078977811506172301 0.0005 9.9582e-08 0.1119 -1 -9009602369958523731 0.0005 8.9398e-07 0.4155 -2 -8990894093332793487 0.0005 2.8346e-07 0.0409 -3 -8915955323477460297 0.0003 1.8926e-07 0.0181 -4 -8858715981476206597 0.0002 3.8685e-08 0.0144 +0 -9078977811506172301 0.0005 9.9580e-08 0.1119 +1 -9009602369958523731 0.0005 8.9400e-07 0.4155 +2 -8990894093332793487 0.0005 2.8350e-07 0.0409 +3 -8915955323477460297 0.0003 1.8930e-07 0.0181 +4 -8858715981476206597 0.0002 3.8680e-08 0.0144 .. ... ... ... ... -95 -3220457216356394124 0.0002 4.4892e-08 0.0274 -96 -3212703409469281429 0.0008 7.2903e-07 0.0154 +95 -3220457216356394124 0.0002 4.4890e-08 0.0274 +96 -3212703409469281429 0.0008 7.2900e-07 0.0154 97 -3196707605593292319 0.0002 4.1300e-08 0.0482 -98 -3129995828656718688 0.0002 3.8685e-08 0.0435 +98 -3129995828656718688 0.0002 3.8680e-08 0.0435 99 -3096050638984928024 0.0002 9.0820e-08 0.0420 [100 rows x 4 columns] diff --git a/tests/_regtest_outputs/test_pyprophet_score.test_osw_8.out b/tests/_regtest_outputs/test_pyprophet_score.test_osw_8.out index ff8b9589..0cd6337f 100644 --- a/tests/_regtest_outputs/test_pyprophet_score.test_osw_8.out +++ b/tests/_regtest_outputs/test_pyprophet_score.test_osw_8.out @@ -1,7 +1,7 @@ level score weight 0 ms1 main_var_xcorr_shape 9.5599e-01 1 ms2 main_var_xcorr_shape -2.5707e+00 -2 ms2 var_bseries_score 2.9013e-15 +2 ms2 var_bseries_score 2.9010e-15 3 ms2 var_dotprod_score 4.8268e+00 4 ms2 var_intensity_score 1.8417e+00 5 ms1 var_isotope_correlation_score 9.9777e-02 diff --git a/tests/_regtest_outputs/test_pyprophet_score.test_osw_subsample.out b/tests/_regtest_outputs/test_pyprophet_score.test_osw_subsample.out new file mode 100644 index 00000000..a1f4ff86 --- /dev/null +++ b/tests/_regtest_outputs/test_pyprophet_score.test_osw_subsample.out @@ -0,0 +1,14 @@ + feature_id ms1_precursor_pep ms2_peakgroup_pep ms2_precursor_pep +0 -9078977811506172301 0.007 0.0036 0.0981 +1 -9009602369958523731 0.007 0.0036 0.4161 +2 -8990894093332793487 0.007 0.0036 0.0621 +3 -8915955323477460297 0.007 0.0036 0.0288 +4 -8858715981476206597 0.007 0.0036 0.0046 +.. ... ... ... ... +95 -3220457216356394124 0.007 0.0036 0.0101 +96 -3212703409469281429 0.007 0.0036 0.0046 +97 -3196707605593292319 0.007 0.0036 0.0674 +98 -3129995828656718688 0.007 0.0036 0.0621 +99 -3096050638984928024 0.007 0.0036 0.0513 + +[100 rows x 4 columns] diff --git a/tests/_regtest_outputs/test_pyprophet_score.test_osw_subsample_apply_weights.out b/tests/_regtest_outputs/test_pyprophet_score.test_osw_subsample_apply_weights.out new file mode 100644 index 00000000..b7da8a5c --- /dev/null +++ b/tests/_regtest_outputs/test_pyprophet_score.test_osw_subsample_apply_weights.out @@ -0,0 +1,14 @@ + feature_id ms1_precursor_pep ms2_peakgroup_pep ms2_precursor_pep +0 -9211032279639747263 1.5282e-01 +1 -9202066408251325127 6.6976e-02 +2 -9194114845888269381 1.5282e-01 +3 -9157656806856886367 1.5282e-01 +4 -9154199948799956056 1.5282e-01 +.. ... ... ... ... +95 -7954403927701730016 1.5358e-05 +96 -7945183889919201418 1.5282e-01 +97 -7921043005244251597 5.9199e-02 +98 -7915076791408573751 1.5282e-01 +99 -7898872943061400987 1.1083e-02 + +[100 rows x 4 columns] diff --git a/tests/_regtest_outputs/test_pyprophet_score.test_tsv_1.out b/tests/_regtest_outputs/test_pyprophet_score.test_tsv_1.out index bd928c9a..d5448bf2 100644 --- a/tests/_regtest_outputs/test_pyprophet_score.test_tsv_1.out +++ b/tests/_regtest_outputs/test_pyprophet_score.test_tsv_1.out @@ -20,14 +20,14 @@ 8 -1.1287 5.5410e-02 -0.7005 0.0000 2.1333e+01 8.8764e-01 1.0000e+00 8.8764e-01 5.5410e-02 1.0000 2.7005 363.6672 9 -0.9162 5.1924e-02 -0.1463 0.0000 1.9887e+01 8.2748e-01 1.0000e+00 8.2748e-01 5.1924e-02 1.0000 4.1463 363.1130 10 -0.7036 4.7798e-02 -0.7743 0.0000 1.8259e+01 7.5974e-01 1.0000e+00 7.5974e-01 4.7798e-02 1.0000 5.7743 363.7410 -11 -0.4911 4.1650e-02 -2.1648 0.0000 1.5869e+01 6.6027e-01 1.0000e+00 6.6027e-01 4.1650e-02 1.0000 8.1648 365.1315 +11 -0.4911 4.1650e-02 -2.1648 0.0000 1.5869e+01 6.6027e-01 1.0000e+00 6.6027e-01 4.1650e-02 1.0000 8.1648 365.1314 12 -0.2786 4.1017e-02 0.4710 0.0523 1.5504e+01 6.4512e-01 1.0000e+00 6.4512e-01 4.1017e-02 1.0000 8.5290 362.4957 13 -0.0661 3.4406e-02 0.8688 0.0724 1.2902e+01 5.3684e-01 1.0000e+00 5.3684e-01 3.4406e-02 1.0000 11.1312 362.0979 14 0.1464 2.7190e-02 -0.8643 0.0000 1.0169e+01 4.2312e-01 1.0000e+00 4.2312e-01 2.7190e-02 1.0000 13.8643 363.8310 15 0.3590 2.1154e-02 -2.1428 0.0000 7.8905e+00 3.2832e-01 1.0000e+00 3.2832e-01 2.1154e-02 1.0000 16.1428 365.1095 16 0.5715 1.8472e-02 -2.1616 0.0000 6.8717e+00 2.8593e-01 1.0000e+00 2.8593e-01 1.8472e-02 1.0000 17.1616 365.1283 17 0.7840 1.3393e-02 -3.0646 0.0000 4.9687e+00 2.0674e-01 8.2627e-01 2.0674e-01 1.3393e-02 1.0000 19.0646 366.0313 -18 0.9965 1.0469e-02 -0.1911 0.0000 3.8422e+00 1.5987e-01 6.3893e-01 1.5987e-01 1.0469e-02 1.0000 20.1911 363.1578 +18 0.9965 1.0469e-02 -0.1911 0.0000 3.8422e+00 1.5987e-01 6.3894e-01 1.5987e-01 1.0469e-02 1.0000 20.1911 363.1578 19 1.2090 5.4738e-03 -1.0299 0.0000 2.0034e+00 8.3359e-02 3.1806e-01 8.3359e-02 5.4738e-03 1.0000 22.0299 363.9966 20 1.4216 4.8798e-03 -0.2522 0.0000 1.7811e+00 7.4111e-02 2.8019e-01 7.4111e-02 4.8798e-03 1.0000 22.2522 363.2189 21 1.6341 3.3101e-03 1.1683 0.0487 1.2016e+00 4.9996e-02 1.8487e-01 4.9996e-02 3.3101e-03 0.9968 22.8317 361.7984 @@ -42,7 +42,7 @@ 30 3.5467 1.4724e-05 42.9714 0.6414 4.7117e-03 1.9605e-04 4.3330e-04 1.9605e-04 1.4724e-05 0.8816 24.0286 319.9953 31 3.7593 7.2480e-06 54.9689 0.6958 2.2324e-03 9.2887e-05 1.9065e-04 9.2887e-05 7.2480e-06 0.8486 24.0311 307.9978 32 3.9718 2.7076e-06 63.9675 0.7269 8.0957e-04 3.3685e-05 6.2623e-05 3.3685e-05 2.7076e-06 0.8238 24.0325 298.9992 -33 4.1843 1.2012e-06 74.9670 0.7572 3.4595e-04 1.4395e-05 2.4351e-05 1.4395e-05 1.2012e-06 0.7935 24.0330 287.9997 +33 4.1843 1.2012e-06 74.9670 0.7572 3.4595e-04 1.4394e-05 2.4351e-05 1.4394e-05 1.2012e-06 0.7935 24.0330 287.9997 34 4.3968 5.0882e-07 88.9668 0.7873 1.3942e-04 5.8010e-06 8.6323e-06 5.8010e-06 5.0882e-07 0.7549 24.0332 273.9999 35 4.6093 1.8281e-07 103.9667 0.8122 4.7347e-05 1.9700e-06 2.4108e-06 1.9700e-06 1.8281e-07 0.7136 24.0333 259.0000 36 4.8219 6.8916e-08 120.9667 0.8343 1.6678e-05 6.9394e-07 6.8750e-07 6.9394e-07 6.8916e-08 0.6667 24.0333 242.0000 diff --git a/tests/test_pyprophet_score.py b/tests/test_pyprophet_score.py index 0986f04a..9079d479 100644 --- a/tests/test_pyprophet_score.py +++ b/tests/test_pyprophet_score.py @@ -5,6 +5,7 @@ import shutil import sys import sqlite3 +import math import pandas as pd import pytest @@ -22,6 +23,33 @@ SKIP_PARQUET_TESTS = True +def _round_sig(value, sig_digits=4): + if pd.isna(value) or value == 0: + return value + return round(value, sig_digits - int(math.floor(math.log10(abs(value)))) - 1) + + +def _normalize_peakgroup_regtest_frame(df): + """ + Normalize tiny floating-point values so regtest output is stable across + Python/pandas/platform combinations. This only affects the peakgroup + summary tables used by the OSW/parquet score tests. + """ + normalized = df.head(100).sort_index(axis=1).copy() + float_cols = normalized.select_dtypes(include=["floating"]).columns + + for col in float_cols: + values = normalized[col] + mask = values.notna() & values.ne(0) & values.abs().lt(1e-6) + normalized.loc[mask, col] = values.loc[mask].map(_round_sig) + + return normalized + + +def _print_peakgroup_regtest_frame(df, regtest): + print(_normalize_peakgroup_regtest_frame(df), file=regtest) + + # ================== CORE TEST UTILITIES ================== class TestRunner: """Handles execution of pyprophet commands and test setup""" @@ -184,6 +212,8 @@ def execute(self, levels=None, **kwargs): for level in levels: level_cmd = self.config.build_command(self.input_file, level) + if kwargs.get("subsample_ratio"): + level_cmd += f" --subsample_ratio={kwargs['subsample_ratio']}" if kwargs.get("parametric"): level_cmd += " --parametric" if kwargs.get("pfdr"): @@ -231,7 +261,61 @@ def verify(self, regtest): ] table = table.sort_values(sort_cols).reset_index(drop=True) - print(table.head(100).sort_index(axis=1), file=regtest) + _print_peakgroup_regtest_frame(table, regtest) + + def apply_weights(self): + """Apply weights for OSW subsampling workflow""" + if self.is_metabo: + # Metabolomics workflow + cmd = f"pyprophet score --level ms2 --pi0_method=smoother --pi0_lambda 0.001 0 0 --in={self.input_file} --test --ss_iteration_fdr=0.02 --subsample_ratio=1.0" + self.runner.run_command(cmd) + + cmd = f"pyprophet score --level ms2 --pi0_method=smoother --pi0_lambda 0.4 0 0 --in={self.input_file} --apply_weights={self.input_file} --test --ss_iteration_fdr=0.02" + self.runner.run_command(cmd) + else: + # Regular OSW workflow with ms1, ms2, transition levels + cmd = f"pyprophet score --level ms2 --pi0_method=smoother --pi0_lambda 0.001 0 0 --in={self.input_file} --test --ss_iteration_fdr=0.02 --subsample_ratio=1.0" + self.runner.run_command(cmd) + + cmd = f"pyprophet score --level ms2 --pi0_method=smoother --pi0_lambda 0.4 0 0 --in={self.input_file} --apply_weights={self.input_file} --test --ss_iteration_fdr=0.02" + self.runner.run_command(cmd) + + cmd = f"pyprophet score --level transition --pi0_method=smoother --pi0_lambda 0.001 0 0 --in={self.input_file} --test --ss_iteration_fdr=0.02 --subsample_ratio=1.0" + self.runner.run_command(cmd) + + cmd = f"pyprophet score --level transition --pi0_method=smoother --pi0_lambda 0.4 0 0 --in={self.input_file} --apply_weights={self.input_file} --test --ss_iteration_fdr=0.02" + self.runner.run_command(cmd) + + def verify_weights(self, regtest): + """Verify weights applied to OSW files""" + if self.is_metabo: + with sqlite3.connect("test_data_compound.osw") as conn: + table = pd.read_sql_query( + "SELECT * FROM PYPROPHET_WEIGHTS ORDER BY score", conn + ) + else: + config = IPFIOConfig( + infile=self.input_file, + outfile=self.input_file, + subsample_ratio=1.0, + level="peakgroup_precursor", + context="ipf", + ) + config.file_type = "osw" + config.ipf_max_peakgroup_pep = 1.0 + config.ipf_ms1_scoring = False + config.ipf_ms2_scoring = False + reader = ReaderDispatcher.get_reader(config) + table = reader.read(level="peakgroup_precursor") + sort_cols = [ + "feature_id", + "ms2_peakgroup_pep", + "ms1_precursor_pep", + "ms2_precursor_pep", + ] + table = table.sort_values(sort_cols).reset_index(drop=True) + + _print_peakgroup_regtest_frame(table, regtest) class ParquetTestStrategy(TestStrategy): @@ -295,7 +379,7 @@ def verify(self, regtest): "ms2_precursor_pep", ] table = table.sort_values(sort_cols).reset_index(drop=True) - print(table.head(100).sort_index(axis=1), file=regtest) + _print_peakgroup_regtest_frame(table, regtest) def apply_weights(self): # Run scoring without weights to generate initial scores @@ -342,7 +426,7 @@ def verify_weights(self, regtest): "ms2_precursor_pep", ] table = table.sort_values(sort_cols).reset_index(drop=True) - print(table.head(100).sort_index(axis=1), file=regtest) + _print_peakgroup_regtest_frame(table, regtest) class SplitParquetTestStrategy(TestStrategy): @@ -409,7 +493,7 @@ def verify(self, regtest): "ms2_precursor_pep", ] table = table.sort_values(sort_cols).reset_index(drop=True) - print(table.head(100).sort_index(axis=1), file=regtest) + _print_peakgroup_regtest_frame(table, regtest) def apply_weights(self): # Run scoring without weights to generate initial scores @@ -470,7 +554,7 @@ def verify_weights(self, regtest): "ms2_precursor_pep", ] table = table.sort_values(sort_cols).reset_index(drop=True) - print(table.head(100).sort_index(axis=1), file=regtest) + _print_peakgroup_regtest_frame(table, regtest) class MultiSplitParquetTestStrategy(TestStrategy): @@ -540,7 +624,7 @@ def verify(self, regtest): "ms2_precursor_pep", ] table = table.sort_values(sort_cols).reset_index(drop=True) - print(table.head(100).sort_index(axis=1), file=regtest) + _print_peakgroup_regtest_frame(table, regtest) def apply_weights(self): # Run scoring without weights to generate initial scores @@ -601,7 +685,7 @@ def verify_weights(self, regtest): "ms2_precursor_pep", ] table = table.sort_values(sort_cols).reset_index(drop=True) - print(table.head(100).sort_index(axis=1), file=regtest) + _print_peakgroup_regtest_frame(table, regtest) # ================== TEST FIXTURES ================== @@ -837,6 +921,25 @@ def test_osw_histgbc_multilevel(test_runner, test_config, regtest): ) +def test_osw_subsample(test_runner, test_config, regtest): + """Test OSW subsampling for semi-supervised learning""" + run_generic_test( + test_runner, + test_config, + OSWTestStrategy, + regtest, + pi0_lambda="0 0 0", + subsample_ratio=0.5, + ) + + +def test_osw_subsample_apply_weights(test_runner, test_config, regtest): + """Test OSW subsampling with weight application to full dataset""" + run_generic_test_apply_weights( + test_runner, test_config, OSWTestStrategy, regtest + ) + + # Parquet Tests def test_parquet_0(test_runner, test_config, regtest): run_generic_test(