biotite 0.39.0__cp312-cp312-win_amd64.whl → 0.41.0__cp312-cp312-win_amd64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of biotite might be problematic. Click here for more details.

Files changed (121) hide show
  1. biotite/__init__.py +3 -3
  2. biotite/application/dssp/app.py +18 -18
  3. biotite/database/pubchem/download.py +23 -23
  4. biotite/database/pubchem/query.py +7 -7
  5. biotite/database/rcsb/download.py +19 -14
  6. biotite/file.py +17 -9
  7. biotite/sequence/align/banded.c +256 -235
  8. biotite/sequence/align/banded.cp312-win_amd64.pyd +0 -0
  9. biotite/sequence/align/cigar.py +60 -15
  10. biotite/sequence/align/kmeralphabet.c +241 -220
  11. biotite/sequence/align/kmeralphabet.cp312-win_amd64.pyd +0 -0
  12. biotite/sequence/align/kmersimilarity.c +213 -194
  13. biotite/sequence/align/kmersimilarity.cp312-win_amd64.pyd +0 -0
  14. biotite/sequence/align/kmertable.cp312-win_amd64.pyd +0 -0
  15. biotite/sequence/align/kmertable.cpp +231 -203
  16. biotite/sequence/align/localgapped.c +256 -235
  17. biotite/sequence/align/localgapped.cp312-win_amd64.pyd +0 -0
  18. biotite/sequence/align/localungapped.c +233 -212
  19. biotite/sequence/align/localungapped.cp312-win_amd64.pyd +0 -0
  20. biotite/sequence/align/multiple.c +253 -232
  21. biotite/sequence/align/multiple.cp312-win_amd64.pyd +0 -0
  22. biotite/sequence/align/pairwise.c +272 -251
  23. biotite/sequence/align/pairwise.cp312-win_amd64.pyd +0 -0
  24. biotite/sequence/align/permutation.c +213 -194
  25. biotite/sequence/align/permutation.cp312-win_amd64.pyd +0 -0
  26. biotite/sequence/align/selector.c +215 -195
  27. biotite/sequence/align/selector.cp312-win_amd64.pyd +0 -0
  28. biotite/sequence/align/tracetable.c +213 -193
  29. biotite/sequence/align/tracetable.cp312-win_amd64.pyd +0 -0
  30. biotite/sequence/annotation.py +2 -2
  31. biotite/sequence/codec.c +233 -212
  32. biotite/sequence/codec.cp312-win_amd64.pyd +0 -0
  33. biotite/sequence/io/fasta/convert.py +27 -24
  34. biotite/sequence/phylo/nj.c +213 -194
  35. biotite/sequence/phylo/nj.cp312-win_amd64.pyd +0 -0
  36. biotite/sequence/phylo/tree.c +225 -200
  37. biotite/sequence/phylo/tree.cp312-win_amd64.pyd +0 -0
  38. biotite/sequence/phylo/upgma.c +213 -194
  39. biotite/sequence/phylo/upgma.cp312-win_amd64.pyd +0 -0
  40. biotite/structure/__init__.py +2 -0
  41. biotite/structure/basepairs.py +7 -12
  42. biotite/structure/bonds.c +1435 -1277
  43. biotite/structure/bonds.cp312-win_amd64.pyd +0 -0
  44. biotite/structure/celllist.c +215 -195
  45. biotite/structure/celllist.cp312-win_amd64.pyd +0 -0
  46. biotite/structure/charges.c +1050 -1099
  47. biotite/structure/charges.cp312-win_amd64.pyd +0 -0
  48. biotite/structure/dotbracket.py +2 -0
  49. biotite/structure/filter.py +30 -37
  50. biotite/structure/info/__init__.py +5 -8
  51. biotite/structure/info/atoms.py +31 -68
  52. biotite/structure/info/bonds.py +47 -101
  53. biotite/structure/info/ccd/README.rst +8 -0
  54. biotite/structure/info/ccd/amino_acids.txt +1663 -0
  55. biotite/structure/info/ccd/carbohydrates.txt +1135 -0
  56. biotite/structure/info/ccd/components.bcif +0 -0
  57. biotite/structure/info/ccd/nucleotides.txt +798 -0
  58. biotite/structure/info/ccd.py +95 -0
  59. biotite/structure/info/groups.py +90 -0
  60. biotite/structure/info/masses.py +21 -20
  61. biotite/structure/info/misc.py +78 -25
  62. biotite/structure/info/standardize.py +17 -12
  63. biotite/structure/integrity.py +19 -70
  64. biotite/structure/io/__init__.py +2 -4
  65. biotite/structure/io/ctab.py +12 -106
  66. biotite/structure/io/general.py +167 -181
  67. biotite/structure/io/gro/file.py +16 -16
  68. biotite/structure/io/mmtf/__init__.py +3 -0
  69. biotite/structure/io/mmtf/convertarray.c +217 -196
  70. biotite/structure/io/mmtf/convertarray.cp312-win_amd64.pyd +0 -0
  71. biotite/structure/io/mmtf/convertfile.c +215 -195
  72. biotite/structure/io/mmtf/convertfile.cp312-win_amd64.pyd +0 -0
  73. biotite/structure/io/mmtf/decode.c +223 -202
  74. biotite/structure/io/mmtf/decode.cp312-win_amd64.pyd +0 -0
  75. biotite/structure/io/mmtf/encode.c +213 -194
  76. biotite/structure/io/mmtf/encode.cp312-win_amd64.pyd +0 -0
  77. biotite/structure/io/mmtf/file.py +34 -26
  78. biotite/structure/io/mol/__init__.py +4 -2
  79. biotite/structure/io/mol/convert.py +71 -7
  80. biotite/structure/io/mol/ctab.py +414 -0
  81. biotite/structure/io/mol/header.py +116 -0
  82. biotite/structure/io/mol/{file.py → mol.py} +69 -82
  83. biotite/structure/io/mol/sdf.py +909 -0
  84. biotite/structure/io/npz/__init__.py +3 -0
  85. biotite/structure/io/npz/file.py +21 -18
  86. biotite/structure/io/pdb/__init__.py +3 -3
  87. biotite/structure/io/pdb/file.py +89 -34
  88. biotite/structure/io/pdb/hybrid36.c +63 -43
  89. biotite/structure/io/pdb/hybrid36.cp312-win_amd64.pyd +0 -0
  90. biotite/structure/io/pdbqt/file.py +32 -32
  91. biotite/structure/io/pdbx/__init__.py +12 -6
  92. biotite/structure/io/pdbx/bcif.py +648 -0
  93. biotite/structure/io/pdbx/cif.py +1032 -0
  94. biotite/structure/io/pdbx/component.py +246 -0
  95. biotite/structure/io/pdbx/convert.py +858 -386
  96. biotite/structure/io/pdbx/encoding.c +112803 -0
  97. biotite/structure/io/pdbx/encoding.cp312-win_amd64.pyd +0 -0
  98. biotite/structure/io/pdbx/legacy.py +267 -0
  99. biotite/structure/molecules.py +151 -151
  100. biotite/structure/repair.py +253 -0
  101. biotite/structure/sasa.c +213 -194
  102. biotite/structure/sasa.cp312-win_amd64.pyd +0 -0
  103. biotite/structure/sequence.py +112 -0
  104. biotite/structure/superimpose.py +618 -116
  105. {biotite-0.39.0.dist-info → biotite-0.41.0.dist-info}/METADATA +3 -3
  106. {biotite-0.39.0.dist-info → biotite-0.41.0.dist-info}/RECORD +109 -103
  107. {biotite-0.39.0.dist-info → biotite-0.41.0.dist-info}/WHEEL +1 -1
  108. biotite/structure/info/amino_acids.json +0 -1556
  109. biotite/structure/info/amino_acids.py +0 -42
  110. biotite/structure/info/carbohydrates.json +0 -1122
  111. biotite/structure/info/carbohydrates.py +0 -39
  112. biotite/structure/info/intra_bonds.msgpack +0 -0
  113. biotite/structure/info/link_types.msgpack +0 -1
  114. biotite/structure/info/nucleotides.json +0 -772
  115. biotite/structure/info/nucleotides.py +0 -39
  116. biotite/structure/info/residue_masses.msgpack +0 -0
  117. biotite/structure/info/residue_names.msgpack +0 -3
  118. biotite/structure/info/residues.msgpack +0 -0
  119. biotite/structure/io/pdbx/file.py +0 -652
  120. {biotite-0.39.0.dist-info → biotite-0.41.0.dist-info}/LICENSE.rst +0 -0
  121. {biotite-0.39.0.dist-info → biotite-0.41.0.dist-info}/top_level.txt +0 -0
@@ -9,6 +9,9 @@ format is used to store `NumPy` arrays. Since atom arrays and stacks are
9
9
  completely built on `NumPy` arrays, this format is preferable for
10
10
  Biotite internal usage due to fast I/O operations and preservation
11
11
  of all atom annotation arrays.
12
+
13
+ DEPRECATED: Pickle data directly or use
14
+ :class:`biotite.structure.io.pdbx.BinaryCIFFile` instead.
12
15
  """
13
16
 
14
17
  __name__ = "biotite.structure.io.npz"
@@ -15,19 +15,22 @@ from ....file import File, is_binary
15
15
  class NpzFile(File):
16
16
  r"""
17
17
  This class represents a NPZ file, the preferable format for
18
- Biotite internal structure storage.
19
-
18
+ Biotite internal structure storage.
19
+
20
20
  Internally the this class writes/reads all attribute arrays of an
21
21
  :class:`AtomArray` or :class:`AtomArrayStack` using the *NumPy*
22
22
  :func:`save()`/:func:`load()`
23
23
  method. This format offers the fastest I/O operations and completely
24
24
  preserves the content all atom annotation arrays.
25
-
25
+
26
+ DEPRECATED: Pickle data directly or use
27
+ :class:`biotite.structure.io.pdbx.BinaryCIFFile` instead.
28
+
26
29
  Examples
27
30
  --------
28
31
  Load a \\*.npz file, modify the structure and save the new
29
32
  structure into a new file:
30
-
33
+
31
34
  >>> import os.path
32
35
  >>> file = NpzFile.read(os.path.join(path_to_structures, "1l2y.npz"))
33
36
  >>> array_stack = file.get_structure()
@@ -35,30 +38,30 @@ class NpzFile(File):
35
38
  >>> file = NpzFile()
36
39
  >>> file.set_structure(array_stack_mod)
37
40
  >>> file.write(os.path.join(path_to_directory, "1l2y_mod.npz"))
38
-
41
+
39
42
  """
40
-
43
+
41
44
  def __init__(self):
42
45
  super().__init__()
43
46
  self._data_dict = None
44
-
47
+
45
48
  def __copy_fill__(self, clone):
46
49
  super().__copy_fill__(clone)
47
50
  if self._data_dict is not None:
48
51
  for key, value in self._data_dict.items():
49
52
  clone._data_dict[key] = np.copy(value)
50
-
53
+
51
54
  @classmethod
52
55
  def read(cls, file):
53
56
  """
54
57
  Read a NPZ file.
55
-
58
+
56
59
  Parameters
57
60
  ----------
58
61
  file : file-like object or str
59
62
  The file to be read.
60
63
  Alternatively a file path can be supplied.
61
-
64
+
62
65
  Returns
63
66
  -------
64
67
  file_object : NPZFile
@@ -75,11 +78,11 @@ class NpzFile(File):
75
78
  raise TypeError("A file opened in 'binary' mode is required")
76
79
  npz_file._data_dict = dict(np.load(file, allow_pickle=False))
77
80
  return npz_file
78
-
81
+
79
82
  def write(self, file):
80
83
  """
81
84
  Write a NPZ file.
82
-
85
+
83
86
  Parameters
84
87
  ----------
85
88
  file : file-like object or str
@@ -93,15 +96,15 @@ class NpzFile(File):
93
96
  if not is_binary(file):
94
97
  raise TypeError("A file opened in 'binary' mode is required")
95
98
  np.savez(file, **self._data_dict)
96
-
99
+
97
100
  def get_structure(self):
98
101
  """
99
102
  Get an :class:`AtomArray` or :class:`AtomArrayStack` from the
100
103
  file.
101
-
104
+
102
105
  If this method returns an array or stack depends on which type
103
106
  of object was used when the file was written.
104
-
107
+
105
108
  Returns
106
109
  -------
107
110
  array : AtomArray or AtomArrayStack
@@ -117,7 +120,7 @@ class NpzFile(File):
117
120
  array = AtomArrayStack(coord.shape[0], coord.shape[1])
118
121
  else:
119
122
  array = AtomArray(coord.shape[0])
120
-
123
+
121
124
  for key, value in self._data_dict.items():
122
125
  if key == "coord":
123
126
  array.coord = value
@@ -128,12 +131,12 @@ class NpzFile(File):
128
131
  else:
129
132
  array.set_annotation(key, value)
130
133
  return array
131
-
134
+
132
135
  def set_structure(self, array):
133
136
  """
134
137
  Set the :class:`AtomArray` or :class:`AtomArrayStack` for the
135
138
  file.
136
-
139
+
137
140
  Parameters
138
141
  ----------
139
142
  array : AtomArray or AtomArrayStack
@@ -6,11 +6,11 @@
6
6
  This subpackage is used for reading and writing an :class:`AtomArray` or
7
7
  :class:`AtomArrayStack` using the popular PDB format.
8
8
  Since this format has some limitations, it will be completely replaced
9
- someday by the modern PDBx/mmCIF format.
9
+ someday by the modern PDBx format.
10
10
  Therefore this subpackage should only be used, if usage of the
11
- PDBx/mmCIF format is not suitable (e.g. when interfacing
11
+ PDBx (CIF or BinaryCIF) format is not suitable (e.g. when interfacing
12
12
  other software).
13
- In all other cases, usage of the ``pdbx`` subpackage is encouraged.
13
+ In all other cases, usage of the :mod:`pdbx` subpackage is encouraged.
14
14
  """
15
15
 
16
16
  __name__ = "biotite.structure.io.pdb"
@@ -12,7 +12,7 @@ from ...atoms import AtomArray, AtomArrayStack, repeat
12
12
  from ...bonds import BondList, connect_via_residue_names
13
13
  from ...box import vectors_from_unitcell, unitcell_from_vectors
14
14
  from ....file import TextFile, InvalidFileError
15
- from ..general import _guess_element as guess_element
15
+ from ...repair import infer_elements
16
16
  from ...error import BadStructureError
17
17
  from ...filter import (
18
18
  filter_first_altloc,
@@ -23,6 +23,9 @@ from ...util import matrix_rotate
23
23
  from .hybrid36 import encode_hybrid36, decode_hybrid36, max_hybrid36_number
24
24
 
25
25
 
26
+ _PDB_MAX_ATOMS = 99999
27
+ _PDB_MAX_RESIDUES = 9999
28
+
26
29
  # slice objects for readability
27
30
  # ATOM/HETATM
28
31
  _record = slice(0, 6)
@@ -53,7 +56,8 @@ class PDBFile(TextFile):
53
56
  r"""
54
57
  This class represents a PDB file.
55
58
 
56
- The usage of PDBxFile is encouraged in favor of this class.
59
+ The usage of :mod:`biotite.structure.io.pdbx` is encouraged in favor
60
+ of this class.
57
61
 
58
62
  This class only provides support for reading/writing the pure atom
59
63
  information (*ATOM*, *HETATM*, *MODEL* and *ENDMDL* records). *TER*
@@ -62,7 +66,8 @@ class PDBFile(TextFile):
62
66
 
63
67
  See also
64
68
  --------
65
- PDBxFile
69
+ CIFFile
70
+ BinaryCIFFile
66
71
 
67
72
  Examples
68
73
  --------
@@ -458,15 +463,14 @@ class PDBFile(TextFile):
458
463
 
459
464
  # Replace empty strings for elements with guessed types
460
465
  # This is used e.g. for PDB files created by Gromacs
461
- if "" in array.element:
462
- rep_num = 0
463
- for idx in range(len(array.element)):
464
- if not array.element[idx]:
465
- atom_name = array.atom_name[idx]
466
- array.element[idx] = guess_element(atom_name)
467
- rep_num += 1
466
+ empty_element_mask = array.element == ""
467
+ if empty_element_mask.any():
468
468
  warnings.warn(
469
- "{} elements were guessed from atom_name.".format(rep_num)
469
+ f"{np.count_nonzero(empty_element_mask)} elements "
470
+ "were guessed from atom name"
471
+ )
472
+ array.element[empty_element_mask] = infer_elements(
473
+ array.atom_name[empty_element_mask]
470
474
  )
471
475
 
472
476
  # Fill in coordinates
@@ -510,7 +514,7 @@ class PDBFile(TextFile):
510
514
  warnings.warn(
511
515
  "File contains invalid 'CRYST1' record, box is ignored"
512
516
  )
513
- box = None
517
+ break
514
518
 
515
519
  if isinstance(array, AtomArray):
516
520
  array.box = box
@@ -572,6 +576,8 @@ class PDBFile(TextFile):
572
576
  records are also written for all non-water hetero residues
573
577
  and all inter-residue connections.
574
578
  """
579
+ _check_pdb_compatibility(array, hybrid36)
580
+
575
581
  natoms = array.array_length()
576
582
  annot_categories = array.get_annotation_categories()
577
583
  record = np.char.array(np.where(array.hetero, "HETATM", "ATOM"))
@@ -597,25 +603,6 @@ class PDBFile(TextFile):
597
603
  else:
598
604
  charge = np.char.array(np.full(natoms, " ", dtype="U2"))
599
605
 
600
- # Do checks on atom array (stack)
601
- if hybrid36:
602
- max_atoms = max_hybrid36_number(5)
603
- max_residues = max_hybrid36_number(4)
604
- else:
605
- max_atoms, max_residues = 99999, 9999
606
- if array.array_length() > max_atoms:
607
- warnings.warn(f"More then {max_atoms:,} atoms per model")
608
- if (array.res_id > max_residues).any():
609
- warnings.warn(f"Residue IDs exceed {max_residues:,}")
610
- if np.isnan(array.coord).any():
611
- raise BadStructureError("Coordinates contain 'NaN' values")
612
- if any([len(name) > 1 for name in array.chain_id]):
613
- raise BadStructureError("Some chain IDs exceed 1 character")
614
- if any([len(name) > 3 for name in array.res_name]):
615
- raise BadStructureError("Some residue names exceed 3 characters")
616
- if any([len(name) > 4 for name in array.atom_name]):
617
- raise BadStructureError("Some atom names exceed 4 characters")
618
-
619
606
  if hybrid36:
620
607
  pdb_atom_id = np.char.array(
621
608
  [encode_hybrid36(i, 5) for i in atom_id]
@@ -628,14 +615,14 @@ class PDBFile(TextFile):
628
615
  # but negative IDs are also possible
629
616
  pdb_atom_id = np.char.array(np.where(
630
617
  atom_id > 0,
631
- ((atom_id - 1) % 99999) + 1,
618
+ ((atom_id - 1) % _PDB_MAX_ATOMS) + 1,
632
619
  atom_id
633
620
  ).astype(str))
634
621
  # Residue IDs are supported up to 9999,
635
622
  # but negative IDs are also possible
636
623
  pdb_res_id = np.char.array(np.where(
637
624
  array.res_id > 0,
638
- ((array.res_id - 1) % 9999) + 1,
625
+ ((array.res_id - 1) % _PDB_MAX_RESIDUES) + 1,
639
626
  array.res_id
640
627
  ).astype(str))
641
628
 
@@ -1182,4 +1169,72 @@ def _apply_transformations(structure, rotations, translations):
1182
1169
  coord += translation
1183
1170
  assembly_coord[i] = coord
1184
1171
 
1185
- return repeat(structure, assembly_coord)
1172
+ return repeat(structure, assembly_coord)
1173
+
1174
+
1175
+ def _check_pdb_compatibility(array, hybrid36):
1176
+ annot_categories = array.get_annotation_categories()
1177
+
1178
+ if hybrid36:
1179
+ max_atoms = max_hybrid36_number(5)
1180
+ max_residues = max_hybrid36_number(4)
1181
+ else:
1182
+ max_atoms, max_residues = _PDB_MAX_ATOMS, _PDB_MAX_RESIDUES
1183
+ if "atom_id" in annot_categories:
1184
+ max_atom_id = np.max(array.atom_id)
1185
+ else:
1186
+ max_atom_id = array.array_length()
1187
+
1188
+ if max_atom_id > max_atoms:
1189
+ warnings.warn(f"Atom IDs exceed {max_atoms:,}, will be wrapped")
1190
+ if (array.res_id > max_residues).any():
1191
+ warnings.warn(f"Residue IDs exceed {max_residues:,}, will be wrapped")
1192
+ if np.isnan(array.coord).any():
1193
+ raise BadStructureError("Coordinates contain 'NaN' values")
1194
+ if any([len(name) > 1 for name in array.chain_id]):
1195
+ raise BadStructureError("Some chain IDs exceed 1 character")
1196
+ if any([len(name) > 3 for name in array.res_name]):
1197
+ raise BadStructureError("Some residue names exceed 3 characters")
1198
+ if any([len(name) > 4 for name in array.atom_name]):
1199
+ raise BadStructureError("Some atom names exceed 4 characters")
1200
+ for i, coord_name in enumerate(["x", "y", "z"]):
1201
+ n_coord_digits = _number_of_integer_digits(array.coord[..., i])
1202
+ if n_coord_digits > 4:
1203
+ raise BadStructureError(
1204
+ f"4 pre-decimal columns for {coord_name}-coordinates are "
1205
+ f"available, but array would require {n_coord_digits}"
1206
+ )
1207
+ if "b_factor" in annot_categories:
1208
+ n_b_factor_digits = _number_of_integer_digits(array.b_factor)
1209
+ if n_b_factor_digits > 3:
1210
+ raise BadStructureError(
1211
+ "3 pre-decimal columns for B-factor are available, "
1212
+ f"but array would require {n_b_factor_digits}"
1213
+ )
1214
+ if "occupancy" in annot_categories:
1215
+ n_occupancy_digits = _number_of_integer_digits(array.occupancy)
1216
+ if n_occupancy_digits > 3:
1217
+ raise BadStructureError(
1218
+ "3 pre-decimal columns for occupancy are available, "
1219
+ f"but array would require {n_occupancy_digits}"
1220
+ )
1221
+ if "charge" in annot_categories:
1222
+ # The sign can be omitted is it is put into the adjacent column
1223
+ n_charge_digits = _number_of_integer_digits(np.abs(array.charge))
1224
+ if n_charge_digits > 1:
1225
+ raise BadStructureError(
1226
+ "1 column for charge is available, "
1227
+ f"but array would require {n_charge_digits}"
1228
+ )
1229
+
1230
+
1231
+ def _number_of_integer_digits(values):
1232
+ """
1233
+ Get the maximum number of characters needed to represent the
1234
+ pre-decimal positions of the given numeric values.
1235
+ """
1236
+ values = values.astype(int, copy=False)
1237
+ n_digits = 0
1238
+ n_digits = max(n_digits, len(str(np.min(values))))
1239
+ n_digits = max(n_digits, len(str(np.max(values))))
1240
+ return n_digits
@@ -1,4 +1,4 @@
1
- /* Generated by Cython 3.0.7 */
1
+ /* Generated by Cython 3.0.10 */
2
2
 
3
3
  /* BEGIN: Cython Metadata
4
4
  {
@@ -36,10 +36,10 @@ END: Cython Metadata */
36
36
  #else
37
37
  #define __PYX_EXTRA_ABI_MODULE_NAME ""
38
38
  #endif
39
- #define CYTHON_ABI "3_0_7" __PYX_EXTRA_ABI_MODULE_NAME
39
+ #define CYTHON_ABI "3_0_10" __PYX_EXTRA_ABI_MODULE_NAME
40
40
  #define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI
41
41
  #define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "."
42
- #define CYTHON_HEX_VERSION 0x030007F0
42
+ #define CYTHON_HEX_VERSION 0x03000AF0
43
43
  #define CYTHON_FUTURE_DIVISION 1
44
44
  #include <stddef.h>
45
45
  #ifndef offsetof
@@ -131,6 +131,8 @@ END: Cython Metadata */
131
131
  #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
132
132
  #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
133
133
  #endif
134
+ #undef CYTHON_USE_FREELISTS
135
+ #define CYTHON_USE_FREELISTS 0
134
136
  #elif defined(PYPY_VERSION)
135
137
  #define CYTHON_COMPILING_IN_PYPY 1
136
138
  #define CYTHON_COMPILING_IN_CPYTHON 0
@@ -192,6 +194,8 @@ END: Cython Metadata */
192
194
  #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
193
195
  #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
194
196
  #endif
197
+ #undef CYTHON_USE_FREELISTS
198
+ #define CYTHON_USE_FREELISTS 0
195
199
  #elif defined(CYTHON_LIMITED_API)
196
200
  #ifdef Py_LIMITED_API
197
201
  #undef __PYX_LIMITED_VERSION_HEX
@@ -253,6 +257,8 @@ END: Cython Metadata */
253
257
  #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
254
258
  #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
255
259
  #endif
260
+ #undef CYTHON_USE_FREELISTS
261
+ #define CYTHON_USE_FREELISTS 0
256
262
  #elif defined(Py_GIL_DISABLED) || defined(Py_NOGIL)
257
263
  #define CYTHON_COMPILING_IN_PYPY 0
258
264
  #define CYTHON_COMPILING_IN_CPYTHON 0
@@ -262,11 +268,17 @@ END: Cython Metadata */
262
268
  #ifndef CYTHON_USE_TYPE_SLOTS
263
269
  #define CYTHON_USE_TYPE_SLOTS 1
264
270
  #endif
271
+ #ifndef CYTHON_USE_TYPE_SPECS
272
+ #define CYTHON_USE_TYPE_SPECS 0
273
+ #endif
265
274
  #undef CYTHON_USE_PYTYPE_LOOKUP
266
275
  #define CYTHON_USE_PYTYPE_LOOKUP 0
267
276
  #ifndef CYTHON_USE_ASYNC_SLOTS
268
277
  #define CYTHON_USE_ASYNC_SLOTS 1
269
278
  #endif
279
+ #ifndef CYTHON_USE_PYLONG_INTERNALS
280
+ #define CYTHON_USE_PYLONG_INTERNALS 0
281
+ #endif
270
282
  #undef CYTHON_USE_PYLIST_INTERNALS
271
283
  #define CYTHON_USE_PYLIST_INTERNALS 0
272
284
  #ifndef CYTHON_USE_UNICODE_INTERNALS
@@ -274,8 +286,6 @@ END: Cython Metadata */
274
286
  #endif
275
287
  #undef CYTHON_USE_UNICODE_WRITER
276
288
  #define CYTHON_USE_UNICODE_WRITER 0
277
- #undef CYTHON_USE_PYLONG_INTERNALS
278
- #define CYTHON_USE_PYLONG_INTERNALS 0
279
289
  #ifndef CYTHON_AVOID_BORROWED_REFS
280
290
  #define CYTHON_AVOID_BORROWED_REFS 0
281
291
  #endif
@@ -287,11 +297,22 @@ END: Cython Metadata */
287
297
  #endif
288
298
  #undef CYTHON_FAST_THREAD_STATE
289
299
  #define CYTHON_FAST_THREAD_STATE 0
300
+ #undef CYTHON_FAST_GIL
301
+ #define CYTHON_FAST_GIL 0
302
+ #ifndef CYTHON_METH_FASTCALL
303
+ #define CYTHON_METH_FASTCALL 1
304
+ #endif
290
305
  #undef CYTHON_FAST_PYCALL
291
306
  #define CYTHON_FAST_PYCALL 0
307
+ #ifndef CYTHON_PEP487_INIT_SUBCLASS
308
+ #define CYTHON_PEP487_INIT_SUBCLASS 1
309
+ #endif
292
310
  #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
293
311
  #define CYTHON_PEP489_MULTI_PHASE_INIT 1
294
312
  #endif
313
+ #ifndef CYTHON_USE_MODULE_STATE
314
+ #define CYTHON_USE_MODULE_STATE 0
315
+ #endif
295
316
  #ifndef CYTHON_USE_TP_FINALIZE
296
317
  #define CYTHON_USE_TP_FINALIZE 1
297
318
  #endif
@@ -299,6 +320,12 @@ END: Cython Metadata */
299
320
  #define CYTHON_USE_DICT_VERSIONS 0
300
321
  #undef CYTHON_USE_EXC_INFO_STACK
301
322
  #define CYTHON_USE_EXC_INFO_STACK 0
323
+ #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
324
+ #define CYTHON_UPDATE_DESCRIPTOR_DOC 1
325
+ #endif
326
+ #ifndef CYTHON_USE_FREELISTS
327
+ #define CYTHON_USE_FREELISTS 0
328
+ #endif
302
329
  #else
303
330
  #define CYTHON_COMPILING_IN_PYPY 0
304
331
  #define CYTHON_COMPILING_IN_CPYTHON 1
@@ -389,6 +416,9 @@ END: Cython Metadata */
389
416
  #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
390
417
  #define CYTHON_UPDATE_DESCRIPTOR_DOC 1
391
418
  #endif
419
+ #ifndef CYTHON_USE_FREELISTS
420
+ #define CYTHON_USE_FREELISTS 1
421
+ #endif
392
422
  #endif
393
423
  #if !defined(CYTHON_FAST_PYCCALL)
394
424
  #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
@@ -581,14 +611,14 @@ END: Cython Metadata */
581
611
  PyObject *exception_table = NULL;
582
612
  PyObject *types_module=NULL, *code_type=NULL, *result=NULL;
583
613
  #if __PYX_LIMITED_VERSION_HEX < 0x030B0000
584
- PyObject *version_info; // borrowed
614
+ PyObject *version_info;
585
615
  PyObject *py_minor_version = NULL;
586
616
  #endif
587
617
  long minor_version = 0;
588
618
  PyObject *type, *value, *traceback;
589
619
  PyErr_Fetch(&type, &value, &traceback);
590
620
  #if __PYX_LIMITED_VERSION_HEX >= 0x030B0000
591
- minor_version = 11; // we don't yet need to distinguish between versions > 11
621
+ minor_version = 11;
592
622
  #else
593
623
  if (!(version_info = PySys_GetObject("version_info"))) goto end;
594
624
  if (!(py_minor_version = PySequence_GetItem(version_info, 1))) goto end;
@@ -646,7 +676,7 @@ END: Cython Metadata */
646
676
  PyObject *fv, PyObject *cell, PyObject* fn,
647
677
  PyObject *name, int fline, PyObject *lnos) {
648
678
  PyCodeObject *result;
649
- PyObject *empty_bytes = PyBytes_FromStringAndSize("", 0); // we don't have access to __pyx_empty_bytes here
679
+ PyObject *empty_bytes = PyBytes_FromStringAndSize("", 0);
650
680
  if (!empty_bytes) return NULL;
651
681
  result =
652
682
  #if PY_VERSION_HEX >= 0x030C0000
@@ -732,8 +762,13 @@ END: Cython Metadata */
732
762
  typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args,
733
763
  Py_ssize_t nargs, PyObject *kwnames);
734
764
  #else
735
- #define __Pyx_PyCFunctionFast _PyCFunctionFast
736
- #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
765
+ #if PY_VERSION_HEX >= 0x030d00A4
766
+ # define __Pyx_PyCFunctionFast PyCFunctionFast
767
+ # define __Pyx_PyCFunctionFastWithKeywords PyCFunctionFastWithKeywords
768
+ #else
769
+ # define __Pyx_PyCFunctionFast _PyCFunctionFast
770
+ # define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
771
+ #endif
737
772
  #endif
738
773
  #if CYTHON_METH_FASTCALL
739
774
  #define __Pyx_METH_FASTCALL METH_FASTCALL
@@ -1085,7 +1120,7 @@ static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict,
1085
1120
  #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_Size(o)
1086
1121
  #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_Size(o)
1087
1122
  #endif
1088
- #if PY_VERSION_HEX >= 0x030d00A1
1123
+ #if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1
1089
1124
  #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name)
1090
1125
  #else
1091
1126
  static CYTHON_INLINE PyObject *__Pyx_PyImport_AddModuleRef(const char *name) {
@@ -1172,7 +1207,7 @@ static CYTHON_INLINE float __PYX_NAN() {
1172
1207
  #endif
1173
1208
 
1174
1209
  #define __PYX_MARK_ERR_POS(f_index, lineno) \
1175
- { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; }
1210
+ { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; }
1176
1211
  #define __PYX_ERR(f_index, lineno, Ln_error) \
1177
1212
  { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; }
1178
1213
 
@@ -1278,24 +1313,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
1278
1313
  #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
1279
1314
  #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s)
1280
1315
  #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
1281
- #if CYTHON_COMPILING_IN_LIMITED_API
1282
- static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const wchar_t *u)
1283
- {
1284
- const wchar_t *u_end = u;
1285
- while (*u_end++) ;
1286
- return (size_t)(u_end - u - 1);
1287
- }
1288
- #else
1289
- static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u)
1290
- {
1291
- const Py_UNICODE *u_end = u;
1292
- while (*u_end++) ;
1293
- return (size_t)(u_end - u - 1);
1294
- }
1295
- #endif
1296
1316
  #define __Pyx_PyUnicode_FromOrdinal(o) PyUnicode_FromOrdinal((int)o)
1297
- #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
1298
- #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
1299
1317
  #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
1300
1318
  #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
1301
1319
  #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
@@ -1345,7 +1363,7 @@ static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*);
1345
1363
  #endif
1346
1364
  typedef Py_ssize_t __Pyx_compact_pylong;
1347
1365
  typedef size_t __Pyx_compact_upylong;
1348
- #else // Py < 3.12
1366
+ #else
1349
1367
  #define __Pyx_PyLong_IsNeg(x) (Py_SIZE(x) < 0)
1350
1368
  #define __Pyx_PyLong_IsNonNeg(x) (Py_SIZE(x) >= 0)
1351
1369
  #define __Pyx_PyLong_IsZero(x) (Py_SIZE(x) == 0)
@@ -1916,8 +1934,8 @@ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int
1916
1934
  #define __Pyx_Arg_NewRef_VARARGS(arg) __Pyx_NewRef(arg)
1917
1935
  #define __Pyx_Arg_XDECREF_VARARGS(arg) Py_XDECREF(arg)
1918
1936
  #else
1919
- #define __Pyx_Arg_NewRef_VARARGS(arg) arg // no-op
1920
- #define __Pyx_Arg_XDECREF_VARARGS(arg) // no-op - arg is borrowed
1937
+ #define __Pyx_Arg_NewRef_VARARGS(arg) arg
1938
+ #define __Pyx_Arg_XDECREF_VARARGS(arg)
1921
1939
  #endif
1922
1940
  #define __Pyx_NumKwargs_VARARGS(kwds) PyDict_Size(kwds)
1923
1941
  #define __Pyx_KwValues_VARARGS(args, nargs) NULL
@@ -1933,8 +1951,9 @@ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int
1933
1951
  #else
1934
1952
  #define __Pyx_KwargsAsDict_FASTCALL(kw, kwvalues) _PyStack_AsDict(kwvalues, kw)
1935
1953
  #endif
1936
- #define __Pyx_Arg_NewRef_FASTCALL(arg) arg // no-op, __Pyx_Arg_FASTCALL is direct and this needs
1937
- #define __Pyx_Arg_XDECREF_FASTCALL(arg) // no-op - arg was returned from array
1954
+ #define __Pyx_Arg_NewRef_FASTCALL(arg) arg /* no-op, __Pyx_Arg_FASTCALL is direct and this needs
1955
+ to have the same reference counting */
1956
+ #define __Pyx_Arg_XDECREF_FASTCALL(arg)
1938
1957
  #else
1939
1958
  #define __Pyx_Arg_FASTCALL __Pyx_Arg_VARARGS
1940
1959
  #define __Pyx_NumKwargs_FASTCALL __Pyx_NumKwargs_VARARGS
@@ -2571,7 +2590,7 @@ typedef struct {
2571
2590
  #endif
2572
2591
  void *defaults;
2573
2592
  int defaults_pyobjects;
2574
- size_t defaults_size; // used by FusedFunction for copying defaults
2593
+ size_t defaults_size;
2575
2594
  int flags;
2576
2595
  PyObject *defaults_tuple;
2577
2596
  PyObject *defaults_kwdict;
@@ -22004,11 +22023,11 @@ static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyO
22004
22023
  {
22005
22024
  int eq = __Pyx_PyUnicode_Equals(s, PyTuple_GET_ITEM(kwnames, i), Py_EQ);
22006
22025
  if (unlikely(eq != 0)) {
22007
- if (unlikely(eq < 0)) return NULL; // error
22026
+ if (unlikely(eq < 0)) return NULL;
22008
22027
  return kwvalues[i];
22009
22028
  }
22010
22029
  }
22011
- return NULL; // not found (no exception set)
22030
+ return NULL;
22012
22031
  }
22013
22032
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000
22014
22033
  CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues) {
@@ -22121,7 +22140,7 @@ static int __Pyx_ParseOptionalKeywords(
22121
22140
  if (*name) {
22122
22141
  values[name-argnames] = value;
22123
22142
  #if CYTHON_AVOID_BORROWED_REFS
22124
- Py_INCREF(value); // transfer ownership of value to values
22143
+ Py_INCREF(value);
22125
22144
  Py_DECREF(key);
22126
22145
  #endif
22127
22146
  key = NULL;
@@ -22140,7 +22159,7 @@ static int __Pyx_ParseOptionalKeywords(
22140
22159
  && _PyString_Eq(**name, key)) {
22141
22160
  values[name-argnames] = value;
22142
22161
  #if CYTHON_AVOID_BORROWED_REFS
22143
- value = NULL; // ownership transferred to values
22162
+ value = NULL;
22144
22163
  #endif
22145
22164
  break;
22146
22165
  }
@@ -22172,7 +22191,7 @@ static int __Pyx_ParseOptionalKeywords(
22172
22191
  if (cmp == 0) {
22173
22192
  values[name-argnames] = value;
22174
22193
  #if CYTHON_AVOID_BORROWED_REFS
22175
- value = NULL; // ownership transferred to values
22194
+ value = NULL;
22176
22195
  #endif
22177
22196
  break;
22178
22197
  }
@@ -24164,9 +24183,10 @@ static CYTHON_INLINE PyObject* __Pyx_decode_c_bytes(
24164
24183
 
24165
24184
  /* UnpackUnboundCMethod */
24166
24185
  static PyObject *__Pyx_SelflessCall(PyObject *method, PyObject *args, PyObject *kwargs) {
24186
+ PyObject *result;
24167
24187
  PyObject *selfless_args = PyTuple_GetSlice(args, 1, PyTuple_Size(args));
24168
24188
  if (unlikely(!selfless_args)) return NULL;
24169
- PyObject *result = PyObject_Call(method, selfless_args, kwargs);
24189
+ result = PyObject_Call(method, selfless_args, kwargs);
24170
24190
  Py_DECREF(selfless_args);
24171
24191
  return result;
24172
24192
  }
@@ -26131,7 +26151,7 @@ static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func,
26131
26151
  default:
26132
26152
  return NULL;
26133
26153
  }
26134
- return ((_PyCFunctionFastWithKeywords)(void(*)(void))def->ml_meth)(self, args, nargs, kwnames);
26154
+ return ((__Pyx_PyCFunctionFastWithKeywords)(void(*)(void))def->ml_meth)(self, args, nargs, kwnames);
26135
26155
  }
26136
26156
  static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
26137
26157
  {
@@ -26590,7 +26610,7 @@ static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
26590
26610
  #else
26591
26611
  py_code = PyCode_NewEmpty(filename, funcname, py_line);
26592
26612
  #endif
26593
- Py_XDECREF(py_funcname); // XDECREF since it's only set on Py3 if cline
26613
+ Py_XDECREF(py_funcname);
26594
26614
  return py_code;
26595
26615
  bad:
26596
26616
  Py_XDECREF(py_funcname);