synkit 1.6.5__py3-none-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.
- synkit/CRN/Benchmark/__init__.py +53 -0
- synkit/CRN/Benchmark/crosschecks.py +13 -0
- synkit/CRN/Benchmark/kegg.py +12 -0
- synkit/CRN/Benchmark/networks.py +13 -0
- synkit/CRN/Benchmark/scaling.py +13 -0
- synkit/CRN/Benchmark/validate.py +13 -0
- synkit/CRN/Construct/__init__.py +16 -0
- synkit/CRN/Construct/abstract.py +668 -0
- synkit/CRN/Construct/arity.py +36 -0
- synkit/CRN/Construct/builder.py +619 -0
- synkit/CRN/Construct/derivation.py +63 -0
- synkit/CRN/Construct/flattener.py +100 -0
- synkit/CRN/Construct/keys.py +14 -0
- synkit/CRN/Construct/mixtures.py +117 -0
- synkit/CRN/Construct/rdkit_worker.py +69 -0
- synkit/CRN/Construct/smiles.py +99 -0
- synkit/CRN/Construct/state.py +31 -0
- synkit/CRN/Construct/strategy.py +75 -0
- synkit/CRN/Construct/worker.py +42 -0
- synkit/CRN/IO/__init__.py +36 -0
- synkit/CRN/IO/sbml.py +925 -0
- synkit/CRN/Pathway/__init__.py +72 -0
- synkit/CRN/Pathway/_adapter.py +333 -0
- synkit/CRN/Pathway/pathfinder.py +500 -0
- synkit/CRN/Pathway/reachability.py +796 -0
- synkit/CRN/Pathway/realizability.py +1322 -0
- synkit/CRN/Petrinet/__init__.py +93 -0
- synkit/CRN/Petrinet/analyzer.py +486 -0
- synkit/CRN/Petrinet/minimal_semiflows.py +436 -0
- synkit/CRN/Petrinet/net.py +1041 -0
- synkit/CRN/Petrinet/persistence.py +97 -0
- synkit/CRN/Petrinet/semiflows.py +483 -0
- synkit/CRN/Petrinet/siphon_search.py +402 -0
- synkit/CRN/Petrinet/structure.py +286 -0
- synkit/CRN/Props/__init__.py +130 -0
- synkit/CRN/Props/_rank.py +29 -0
- synkit/CRN/Props/deficiency.py +953 -0
- synkit/CRN/Props/dynamics.py +832 -0
- synkit/CRN/Props/helper.py +151 -0
- synkit/CRN/Props/stoich.py +751 -0
- synkit/CRN/Props/thermo.py +584 -0
- synkit/CRN/Query/__init__.py +66 -0
- synkit/CRN/Query/cache.py +41 -0
- synkit/CRN/Query/kegg_api.py +99 -0
- synkit/CRN/Query/kegg_extract.py +714 -0
- synkit/CRN/Query/kegg_impute.py +707 -0
- synkit/CRN/Query/kegg_parse.py +480 -0
- synkit/CRN/Query/to_syncrn.py +290 -0
- synkit/CRN/README.md +234 -0
- synkit/CRN/Structure/__init__.py +12 -0
- synkit/CRN/Structure/_graph_io.py +713 -0
- synkit/CRN/Structure/_matrices.py +88 -0
- synkit/CRN/Structure/_parse.py +544 -0
- synkit/CRN/Structure/reaction.py +237 -0
- synkit/CRN/Structure/rule.py +55 -0
- synkit/CRN/Structure/species.py +46 -0
- synkit/CRN/Structure/syncrn.py +929 -0
- synkit/CRN/Symmetry/__init__.py +20 -0
- synkit/CRN/Symmetry/_common.py +1059 -0
- synkit/CRN/Symmetry/_ir.py +940 -0
- synkit/CRN/Symmetry/automorphism.py +472 -0
- synkit/CRN/Symmetry/canon.py +441 -0
- synkit/CRN/Symmetry/isomorphism.py +412 -0
- synkit/CRN/Symmetry/symmetry.py +61 -0
- synkit/CRN/Symmetry/wl_canon.py +967 -0
- synkit/CRN/Visualize/__init__.py +11 -0
- synkit/CRN/Visualize/labels.py +113 -0
- synkit/CRN/Visualize/layout.py +708 -0
- synkit/CRN/Visualize/palette.py +292 -0
- synkit/CRN/Visualize/validation.py +122 -0
- synkit/CRN/Visualize/vis.py +1152 -0
- synkit/CRN/__init__.py +233 -0
- synkit/CRN/_build.py +50 -0
- synkit/CRN/_native_build.py +175 -0
- synkit/CRN/analysis.py +629 -0
- synkit/CRN/backend.py +74 -0
- synkit/CRN/cpp/CMakeLists.txt +58 -0
- synkit/CRN/cpp/algebra.cpp +46 -0
- synkit/CRN/cpp/closure.cpp +29 -0
- synkit/CRN/cpp/exact.h +55 -0
- synkit/CRN/cpp/pathway.cpp +46 -0
- synkit/CRN/cpp/semiflows.cpp +209 -0
- synkit/CRN/cpp/structural.cpp +240 -0
- synkit/CRN/cpp/symmetry.cpp +45 -0
- synkit/CRN/cpp/write_manifest.cmake +28 -0
- synkit/CRN/kinds.py +137 -0
- synkit/CRN/lib/synkit_crn.dll +0 -0
- synkit/CRN/lib/synkit_crn.json +33 -0
- synkit/CRN/native.py +388 -0
- synkit/CRN/native_analysis.py +459 -0
- synkit/Chem/Cluster/__init__.py +0 -0
- synkit/Chem/Cluster/butina.py +140 -0
- synkit/Chem/Fingerprint/__init__.py +0 -0
- synkit/Chem/Fingerprint/fp_calculator.py +155 -0
- synkit/Chem/Fingerprint/smiles_featurizer.py +258 -0
- synkit/Chem/Fingerprint/transformation_fp.py +139 -0
- synkit/Chem/Mapper/README.rst +43 -0
- synkit/Chem/Mapper/__init__.py +255 -0
- synkit/Chem/Mapper/_compat.py +130 -0
- synkit/Chem/Mapper/adapters/__init__.py +1 -0
- synkit/Chem/Mapper/adapters/prediction.py +126 -0
- synkit/Chem/Mapper/adapters/template.py +412 -0
- synkit/Chem/Mapper/chem/__init__.py +52 -0
- synkit/Chem/Mapper/chem/aam.py +673 -0
- synkit/Chem/Mapper/chem/blind.py +160 -0
- synkit/Chem/Mapper/chem/its.py +309 -0
- synkit/Chem/Mapper/chem/smiles.py +564 -0
- synkit/Chem/Mapper/graph/__init__.py +66 -0
- synkit/Chem/Mapper/graph/automorphism.py +395 -0
- synkit/Chem/Mapper/graph/blockcut.py +98 -0
- synkit/Chem/Mapper/graph/labeled_graph.py +104 -0
- synkit/Chem/Mapper/graph/refine.py +176 -0
- synkit/Chem/Mapper/graph/synkit_adapter.py +110 -0
- synkit/Chem/Mapper/io/__init__.py +13 -0
- synkit/Chem/Mapper/io/idxmapstr.py +82 -0
- synkit/Chem/Mapper/mapper.py +685 -0
- synkit/Chem/Mapper/reaction_search.py +554 -0
- synkit/Chem/Mapper/reporting/__init__.py +1 -0
- synkit/Chem/Mapper/reporting/alternatives.py +451 -0
- synkit/Chem/Mapper/reporting/analysis.py +681 -0
- synkit/Chem/Mapper/reporting/native_analysis.py +485 -0
- synkit/Chem/Mapper/reporting/spectrum.py +642 -0
- synkit/Chem/Mapper/solvers/__init__.py +1 -0
- synkit/Chem/Mapper/solvers/exact/__init__.py +141 -0
- synkit/Chem/Mapper/solvers/exact/assignment/__init__.py +1 -0
- synkit/Chem/Mapper/solvers/exact/assignment/assignment_certificate.py +113 -0
- synkit/Chem/Mapper/solvers/exact/assignment/assignment_domains.py +162 -0
- synkit/Chem/Mapper/solvers/exact/assignment/assignment_verification.py +58 -0
- synkit/Chem/Mapper/solvers/exact/assignment/incremental_assignment.py +247 -0
- synkit/Chem/Mapper/solvers/exact/certificate.py +128 -0
- synkit/Chem/Mapper/solvers/exact/core.py +183 -0
- synkit/Chem/Mapper/solvers/exact/distance_search/__init__.py +1 -0
- synkit/Chem/Mapper/solvers/exact/distance_search/bounds.py +319 -0
- synkit/Chem/Mapper/solvers/exact/distance_search/exhaustive.py +179 -0
- synkit/Chem/Mapper/solvers/exact/distance_search/inputs.py +283 -0
- synkit/Chem/Mapper/solvers/exact/distance_search/records.py +242 -0
- synkit/Chem/Mapper/solvers/exact/distance_search/search.py +1025 -0
- synkit/Chem/Mapper/solvers/exact/distance_search/verify.py +378 -0
- synkit/Chem/Mapper/solvers/exact/edit_support.py +375 -0
- synkit/Chem/Mapper/solvers/exact/hybrid.py +224 -0
- synkit/Chem/Mapper/solvers/exact/hydrogen.py +264 -0
- synkit/Chem/Mapper/solvers/exact/kernel_solvers/__init__.py +1 -0
- synkit/Chem/Mapper/solvers/exact/kernel_solvers/branching.py +499 -0
- synkit/Chem/Mapper/solvers/exact/kernel_solvers/enumerate.py +1050 -0
- synkit/Chem/Mapper/solvers/exact/kernel_solvers/enumeration_result.py +30 -0
- synkit/Chem/Mapper/solvers/exact/kernel_solvers/kernel.py +256 -0
- synkit/Chem/Mapper/solvers/exact/kernel_solvers/milp.py +194 -0
- synkit/Chem/Mapper/solvers/exact/native/__init__.py +1 -0
- synkit/Chem/Mapper/solvers/exact/native/build.py +154 -0
- synkit/Chem/Mapper/solvers/exact/native/candidates.py +593 -0
- synkit/Chem/Mapper/solvers/exact/native/canonical.py +396 -0
- synkit/Chem/Mapper/solvers/exact/native/disk_frontier.py +415 -0
- synkit/Chem/Mapper/solvers/exact/native/frontier.py +390 -0
- synkit/Chem/Mapper/solvers/exact/native/hydrogen_quotient.py +213 -0
- synkit/Chem/Mapper/solvers/exact/native/its.py +528 -0
- synkit/Chem/Mapper/solvers/exact/native/native_distance.cpp +2803 -0
- synkit/Chem/Mapper/solvers/exact/native/orbit_aggregation.py +328 -0
- synkit/Chem/Mapper/solvers/exact/native/parallel.py +205 -0
- synkit/Chem/Mapper/solvers/exact/native/pmcd.py +203 -0
- synkit/Chem/Mapper/solvers/exact/native/runtime.py +40 -0
- synkit/Chem/Mapper/solvers/exact/native/search.py +294 -0
- synkit/Chem/Mapper/solvers/exact/native/separator.py +224 -0
- synkit/Chem/Mapper/solvers/exact/native_build.py +12 -0
- synkit/Chem/Mapper/solvers/exact/pabs/__init__.py +1 -0
- synkit/Chem/Mapper/solvers/exact/pabs/cost_lattice.py +43 -0
- synkit/Chem/Mapper/solvers/exact/pabs/factor_spectrum.py +110 -0
- synkit/Chem/Mapper/solvers/exact/pabs/multi_shell.py +368 -0
- synkit/Chem/Mapper/solvers/exact/pabs/propagation.py +679 -0
- synkit/Chem/Mapper/solvers/exact/pabs/propagation_bounds.py +436 -0
- synkit/Chem/Mapper/solvers/exact/pabs/propagation_limits.py +13 -0
- synkit/Chem/Mapper/solvers/exact/pabs/propagation_search.py +856 -0
- synkit/Chem/Mapper/solvers/exact/pabs/propagation_symmetry.py +66 -0
- synkit/Chem/Mapper/solvers/exact/pabs/residual_typed_bonds.py +136 -0
- synkit/Chem/Mapper/solvers/exact/pabs/reward_frontier.py +201 -0
- synkit/Chem/Mapper/solvers/exact/pabs/separator_bound.py +258 -0
- synkit/Chem/Mapper/solvers/exact/pabs/separator_spectrum.py +308 -0
- synkit/Chem/Mapper/solvers/exact/pabs/sparse_reward_bound.py +207 -0
- synkit/Chem/Mapper/solvers/exact/pabs/suffix_spectrum.py +299 -0
- synkit/Chem/Mapper/solvers/exact/search.py +55 -0
- synkit/Chem/Mapper/solvers/exact/seeds/__init__.py +1 -0
- synkit/Chem/Mapper/solvers/exact/seeds/seed.py +104 -0
- synkit/Chem/Mapper/solvers/exact/seeds/seed_fragments.py +148 -0
- synkit/Chem/Mapper/solvers/exact/seeds/seed_relaxation.py +181 -0
- synkit/Chem/Mapper/solvers/exact/symmetry.py +223 -0
- synkit/Chem/Mapper/solvers/native/__init__.py +4 -0
- synkit/Chem/Mapper/solvers/native/assignment.py +99 -0
- synkit/Chem/Mapper/solvers/native/astar.py +22 -0
- synkit/Chem/Mapper/solvers/native/build.py +385 -0
- synkit/Chem/Mapper/solvers/native/classification.py +641 -0
- synkit/Chem/Mapper/solvers/native/core.py +378 -0
- synkit/Chem/Mapper/solvers/native/cpp/CMakeLists.txt +120 -0
- synkit/Chem/Mapper/solvers/native/cpp/examples/map_reaction.cpp +29 -0
- synkit/Chem/Mapper/solvers/native/cpp/examples/slap_graph.cpp +63 -0
- synkit/Chem/Mapper/solvers/native/cpp/include/synkit_mapper/assignment/assignment.h +18 -0
- synkit/Chem/Mapper/solvers/native/cpp/include/synkit_mapper/astar/astar.h +18 -0
- synkit/Chem/Mapper/solvers/native/cpp/include/synkit_mapper/astar/bound.h +33 -0
- synkit/Chem/Mapper/solvers/native/cpp/include/synkit_mapper/core/pmcd_witness.h +16 -0
- synkit/Chem/Mapper/solvers/native/cpp/include/synkit_mapper/core/runtime.h +130 -0
- synkit/Chem/Mapper/solvers/native/cpp/include/synkit_mapper/hydrogen/hydrogen.h +73 -0
- synkit/Chem/Mapper/solvers/native/cpp/include/synkit_mapper/mapper.h +175 -0
- synkit/Chem/Mapper/solvers/native/cpp/include/synkit_mapper/mces/mces.h +9 -0
- synkit/Chem/Mapper/solvers/native/cpp/include/synkit_mapper/pabs/seed.h +34 -0
- synkit/Chem/Mapper/solvers/native/cpp/include/synkit_mapper/reaction/reaction.h +30 -0
- synkit/Chem/Mapper/solvers/native/cpp/include/synkit_mapper/sepdp/sepdp.h +21 -0
- synkit/Chem/Mapper/solvers/native/cpp/include/synkit_mapper/slap.h +72 -0
- synkit/Chem/Mapper/solvers/native/cpp/include/synkit_mapper/solvers/solvers.h +16 -0
- synkit/Chem/Mapper/solvers/native/cpp/include/synkit_mapper/symmetry/classification.h +140 -0
- synkit/Chem/Mapper/solvers/native/cpp/include/synkit_mapper/symmetry/cpabs.h +33 -0
- synkit/Chem/Mapper/solvers/native/cpp/src/assignment/abb.cpp +302 -0
- synkit/Chem/Mapper/solvers/native/cpp/src/astar/CMakeLists.txt +12 -0
- synkit/Chem/Mapper/solvers/native/cpp/src/astar/README.md +47 -0
- synkit/Chem/Mapper/solvers/native/cpp/src/astar/astar.cpp +228 -0
- synkit/Chem/Mapper/solvers/native/cpp/src/astar/astar_graph.cpp +37 -0
- synkit/Chem/Mapper/solvers/native/cpp/src/astar/bound.cpp +212 -0
- synkit/Chem/Mapper/solvers/native/cpp/src/core/dispatch.cpp +272 -0
- synkit/Chem/Mapper/solvers/native/cpp/src/core/pmcd_witness.cpp +36 -0
- synkit/Chem/Mapper/solvers/native/cpp/src/hydrogen/hydrogen.cpp +380 -0
- synkit/Chem/Mapper/solvers/native/cpp/src/mces/README.md +57 -0
- synkit/Chem/Mapper/solvers/native/cpp/src/mces/mces.cpp +287 -0
- synkit/Chem/Mapper/solvers/native/cpp/src/pabs/bridge.cpp +334 -0
- synkit/Chem/Mapper/solvers/native/cpp/src/pabs/chemical_floor.inc +181 -0
- synkit/Chem/Mapper/solvers/native/cpp/src/pabs/endpoint_symmetry.inc +104 -0
- synkit/Chem/Mapper/solvers/native/cpp/src/pabs/exact_helpers.h +20 -0
- synkit/Chem/Mapper/solvers/native/cpp/src/pabs/lp_assignment_certificate.h +165 -0
- synkit/Chem/Mapper/solvers/native/cpp/src/pabs/lp_certificate.h +125 -0
- synkit/Chem/Mapper/solvers/native/cpp/src/pabs/lp_model.h +365 -0
- synkit/Chem/Mapper/solvers/native/cpp/src/pabs/lp_provider.inc +319 -0
- synkit/Chem/Mapper/solvers/native/cpp/src/pabs/lp_rounding.inc +170 -0
- synkit/Chem/Mapper/solvers/native/cpp/src/pabs/lp_test_hooks.h +342 -0
- synkit/Chem/Mapper/solvers/native/cpp/src/pabs/objective_reduction.inc +137 -0
- synkit/Chem/Mapper/solvers/native/cpp/src/pabs/overlap_dual.inc +351 -0
- synkit/Chem/Mapper/solvers/native/cpp/src/pabs/profile_seed.inc +214 -0
- synkit/Chem/Mapper/solvers/native/cpp/src/pabs/seed_heuristics.inc +640 -0
- synkit/Chem/Mapper/solvers/native/cpp/src/pabs/sparse_embedding.cpp +430 -0
- synkit/Chem/Mapper/solvers/native/cpp/src/pabs/sparse_root_lp.h +176 -0
- synkit/Chem/Mapper/solvers/native/cpp/src/pabs/test_hooks.inc +262 -0
- synkit/Chem/Mapper/solvers/native/cpp/src/reaction/reaction.cpp +611 -0
- synkit/Chem/Mapper/solvers/native/cpp/src/sepdp/README.md +61 -0
- synkit/Chem/Mapper/solvers/native/cpp/src/sepdp/sepdp.cpp +253 -0
- synkit/Chem/Mapper/solvers/native/cpp/src/slap.cpp +810 -0
- synkit/Chem/Mapper/solvers/native/cpp/src/solvers/formulation.h +138 -0
- synkit/Chem/Mapper/solvers/native/cpp/src/solvers/maxsat.cpp +526 -0
- synkit/Chem/Mapper/solvers/native/cpp/src/solvers/ortools.cpp +475 -0
- synkit/Chem/Mapper/solvers/native/cpp/src/solvers/seed.h +80 -0
- synkit/Chem/Mapper/solvers/native/cpp/src/solvers/weighted_cnf.h +256 -0
- synkit/Chem/Mapper/solvers/native/cpp/src/supporting/README.md +43 -0
- synkit/Chem/Mapper/solvers/native/cpp/src/supporting/dfs.cpp +123 -0
- synkit/Chem/Mapper/solvers/native/cpp/src/supporting/edit_support.cpp +224 -0
- synkit/Chem/Mapper/solvers/native/cpp/src/symmetry/classification.cpp +553 -0
- synkit/Chem/Mapper/solvers/native/cpp/src/symmetry/classification_pipeline.cpp +124 -0
- synkit/Chem/Mapper/solvers/native/cpp/src/symmetry/classification_stream.h +13 -0
- synkit/Chem/Mapper/solvers/native/cpp/src/symmetry/cpabs.cpp +455 -0
- synkit/Chem/Mapper/solvers/native/cpp/src/symmetry/edge_deck.cpp +743 -0
- synkit/Chem/Mapper/solvers/native/cpp/src/symmetry/vendor/nauty/COPYRIGHT +44 -0
- synkit/Chem/Mapper/solvers/native/cpp/src/symmetry/vendor/nauty/LICENSE-2.0.txt +202 -0
- synkit/Chem/Mapper/solvers/native/cpp/src/symmetry/vendor/nauty/naugraph.c +732 -0
- synkit/Chem/Mapper/solvers/native/cpp/src/symmetry/vendor/nauty/naurng.c +94 -0
- synkit/Chem/Mapper/solvers/native/cpp/src/symmetry/vendor/nauty/naurng.h +49 -0
- synkit/Chem/Mapper/solvers/native/cpp/src/symmetry/vendor/nauty/nausparse.c +1771 -0
- synkit/Chem/Mapper/solvers/native/cpp/src/symmetry/vendor/nauty/nausparse.h +133 -0
- synkit/Chem/Mapper/solvers/native/cpp/src/symmetry/vendor/nauty/nautil.c +750 -0
- synkit/Chem/Mapper/solvers/native/cpp/src/symmetry/vendor/nauty/naututil.h +355 -0
- synkit/Chem/Mapper/solvers/native/cpp/src/symmetry/vendor/nauty/nauty.c +1256 -0
- synkit/Chem/Mapper/solvers/native/cpp/src/symmetry/vendor/nauty/nauty.h +1544 -0
- synkit/Chem/Mapper/solvers/native/cpp/src/symmetry/vendor/nauty/schreier.c +1131 -0
- synkit/Chem/Mapper/solvers/native/cpp/src/symmetry/vendor/nauty/schreier.h +70 -0
- synkit/Chem/Mapper/solvers/native/cpp/src/symmetry/vendor/nauty/sorttemplates.c +580 -0
- synkit/Chem/Mapper/solvers/native/hydrogen.py +711 -0
- synkit/Chem/Mapper/solvers/native/implicit.py +506 -0
- synkit/Chem/Mapper/solvers/native/implicit_certificate.py +187 -0
- synkit/Chem/Mapper/solvers/native/implicit_preparation.py +309 -0
- synkit/Chem/Mapper/solvers/native/lib/synkit_mapper.dll +0 -0
- synkit/Chem/Mapper/solvers/native/mces.py +16 -0
- synkit/Chem/Mapper/solvers/native/reaction.py +179 -0
- synkit/Chem/Mapper/solvers/native/reaction_build.py +277 -0
- synkit/Chem/Mapper/solvers/native/reaction_text.py +26 -0
- synkit/Chem/Mapper/solvers/native/runtime.py +242 -0
- synkit/Chem/Mapper/solvers/native/sepdp.py +47 -0
- synkit/Chem/Mapper/solvers/native/slap.py +266 -0
- synkit/Chem/Mapper/solvers/native/solvers.py +67 -0
- synkit/Chem/Mapper/solvers/native/stereo.py +86 -0
- synkit/Chem/Mapper/solvers/native/supporting.py +34 -0
- synkit/Chem/Mapper/solvers/native/symmetry.py +91 -0
- synkit/Chem/Mapper/solvers/slap/__init__.py +29 -0
- synkit/Chem/Mapper/solvers/slap/lap.py +174 -0
- synkit/Chem/Mapper/solvers/slap/sequential.py +696 -0
- synkit/Chem/Mapper/validation/__init__.py +1 -0
- synkit/Chem/Mapper/validation/aam_validator.py +442 -0
- synkit/Chem/Mapper/validation/annotations.py +274 -0
- synkit/Chem/Mapper/validation/bonds.py +124 -0
- synkit/Chem/Mapper/validation/cohorts.py +72 -0
- synkit/Chem/Mapper/validation/identifiability.py +150 -0
- synkit/Chem/Mapper/validation/numerical_scope.py +36 -0
- synkit/Chem/Mapper/validation/orbits.py +137 -0
- synkit/Chem/Molecule/__init__.py +0 -0
- synkit/Chem/Molecule/_chirality_loci.py +165 -0
- synkit/Chem/Molecule/_chirality_types.py +231 -0
- synkit/Chem/Molecule/_helical_loci.py +167 -0
- synkit/Chem/Molecule/_stereo_axis_evidence.py +202 -0
- synkit/Chem/Molecule/_stereo_element_detection.py +193 -0
- synkit/Chem/Molecule/_stereo_orientation_constraints.py +511 -0
- synkit/Chem/Molecule/_tetrahedral_carriers.py +63 -0
- synkit/Chem/Molecule/atom_features.py +379 -0
- synkit/Chem/Molecule/chirality.py +1041 -0
- synkit/Chem/Molecule/cip_assignment.py +569 -0
- synkit/Chem/Molecule/cip_ranking.py +843 -0
- synkit/Chem/Molecule/coordinate_stereo.py +503 -0
- synkit/Chem/Molecule/derived_stereo_naming.py +165 -0
- synkit/Chem/Molecule/descriptors.py +452 -0
- synkit/Chem/Molecule/formula.py +249 -0
- synkit/Chem/Molecule/global_stereo.py +175 -0
- synkit/Chem/Molecule/graph_annotator.py +300 -0
- synkit/Chem/Molecule/standardize.py +817 -0
- synkit/Chem/Molecule/stereo_evidence.py +179 -0
- synkit/Chem/Molecule/stereo_perception.py +1032 -0
- synkit/Chem/Molecule/valence.py +123 -0
- synkit/Chem/Reaction/Mapper/__init__.py +44 -0
- synkit/Chem/Reaction/__init__.py +20 -0
- synkit/Chem/Reaction/aam_validator.py +5 -0
- synkit/Chem/Reaction/balance_check.py +138 -0
- synkit/Chem/Reaction/canon_rsmi.py +249 -0
- synkit/Chem/Reaction/cleaning.py +58 -0
- synkit/Chem/Reaction/deionize.py +199 -0
- synkit/Chem/Reaction/explicit_h_audit.py +232 -0
- synkit/Chem/Reaction/fix_aam.py +64 -0
- synkit/Chem/Reaction/neutralize.py +207 -0
- synkit/Chem/Reaction/radical_wildcard.py +224 -0
- synkit/Chem/Reaction/standardize.py +203 -0
- synkit/Chem/Reaction/tautomerize.py +205 -0
- synkit/Chem/__init__.py +1 -0
- synkit/Chem/utils.py +315 -0
- synkit/Data/__init__.py +0 -0
- synkit/Data/aldol.json.gz +1 -0
- synkit/Data/gen_partial_aam.py +147 -0
- synkit/Data/paracetamol.json.gz +1 -0
- synkit/Graph/Canon/__init__.py +16 -0
- synkit/Graph/Canon/_native/__init__.py +13 -0
- synkit/Graph/Canon/_native/build.py +93 -0
- synkit/Graph/Canon/_native/lib/synkit_canon.dll +0 -0
- synkit/Graph/Canon/_native/prepare.py +49 -0
- synkit/Graph/Canon/_native/runtime.py +140 -0
- synkit/Graph/Canon/_native/search.py +137 -0
- synkit/Graph/Canon/canon_algs.py +228 -0
- synkit/Graph/Canon/canon_graph.py +531 -0
- synkit/Graph/Canon/cpp/CMakeLists.txt +42 -0
- synkit/Graph/Canon/cpp/README.md +123 -0
- synkit/Graph/Canon/cpp/examples/canonical_graph.cpp +16 -0
- synkit/Graph/Canon/cpp/include/synkit_canon/canon.h +85 -0
- synkit/Graph/Canon/cpp/src/canonical.cpp +391 -0
- synkit/Graph/Canon/cpp/src/symmetry.h +83 -0
- synkit/Graph/Canon/cpp/tests/symmetry.cpp +93 -0
- synkit/Graph/Canon/exact.py +1020 -0
- synkit/Graph/Canon/exact_refinement.py +368 -0
- synkit/Graph/Canon/nauty.py +143 -0
- synkit/Graph/Context/__init__.py +0 -0
- synkit/Graph/Context/hier_context.py +244 -0
- synkit/Graph/Context/radius_expand.py +252 -0
- synkit/Graph/FG/__init__.py +19 -0
- synkit/Graph/FG/api.py +39 -0
- synkit/Graph/FG/audit.py +155 -0
- synkit/Graph/FG/catalog.py +919 -0
- synkit/Graph/FG/detector.py +288 -0
- synkit/Graph/FG/model.py +97 -0
- synkit/Graph/FG/recognizers.py +274 -0
- synkit/Graph/FG/ring_system.py +154 -0
- synkit/Graph/Feature/Descriptors/topology.py +857 -0
- synkit/Graph/Feature/Fingerprint/__init__.py +0 -0
- synkit/Graph/Feature/Fingerprint/wl_rxn_fps.py +222 -0
- synkit/Graph/Feature/__init__.py +5 -0
- synkit/Graph/Feature/graph_descriptors.py +323 -0
- synkit/Graph/Feature/graph_fps.py +96 -0
- synkit/Graph/Feature/graph_signature.py +239 -0
- synkit/Graph/Feature/hash_fps.py +133 -0
- synkit/Graph/Feature/morgan_fps.py +88 -0
- synkit/Graph/Feature/path_fps.py +81 -0
- synkit/Graph/Feature/wl_hash.py +134 -0
- synkit/Graph/Fusion/__init__.py +85 -0
- synkit/Graph/Fusion/candidate.py +559 -0
- synkit/Graph/Fusion/constructor.py +877 -0
- synkit/Graph/Fusion/identity.py +184 -0
- synkit/Graph/Fusion/interface.py +700 -0
- synkit/Graph/Fusion/search.py +241 -0
- synkit/Graph/Hyrogen/__init__.py +6 -0
- synkit/Graph/Hyrogen/_misc.py +591 -0
- synkit/Graph/Hyrogen/hcomplete.py +995 -0
- synkit/Graph/Hyrogen/hcomplete_legacy.py +368 -0
- synkit/Graph/Hyrogen/hcompletion_algorithms.py +713 -0
- synkit/Graph/Hyrogen/hextend.py +570 -0
- synkit/Graph/Hyrogen/hextend_legacy.py +215 -0
- synkit/Graph/ITS/__init__.py +4 -0
- synkit/Graph/ITS/its_builder.py +120 -0
- synkit/Graph/ITS/its_construction.py +719 -0
- synkit/Graph/ITS/its_decompose.py +572 -0
- synkit/Graph/ITS/its_destruction.py +331 -0
- synkit/Graph/ITS/its_expand.py +1251 -0
- synkit/Graph/ITS/its_relabel.py +187 -0
- synkit/Graph/ITS/its_reverter.py +356 -0
- synkit/Graph/ITS/normalize_aam.py +145 -0
- synkit/Graph/ITS/partial_its.py +238 -0
- synkit/Graph/ITS/rc_extractor.py +656 -0
- synkit/Graph/ITS/stereo.py +74 -0
- synkit/Graph/MTG/__init__.py +107 -0
- synkit/Graph/MTG/gluing.py +451 -0
- synkit/Graph/MTG/history.py +928 -0
- synkit/Graph/MTG/inventory.py +118 -0
- synkit/Graph/MTG/local.py +447 -0
- synkit/Graph/MTG/mcs_matcher.py +246 -0
- synkit/Graph/MTG/mtg.py +611 -0
- synkit/Graph/MTG/mtg_explore.py +74 -0
- synkit/Graph/MTG/observation.py +209 -0
- synkit/Graph/MTG/process.py +577 -0
- synkit/Graph/MTG/queries.py +66 -0
- synkit/Graph/MTG/realization.py +95 -0
- synkit/Graph/MTG/series_parallel.py +107 -0
- synkit/Graph/MTG/utils.py +424 -0
- synkit/Graph/Matcher/__init__.py +10 -0
- synkit/Graph/Matcher/approx_mcs.py +1264 -0
- synkit/Graph/Matcher/auto_est.py +736 -0
- synkit/Graph/Matcher/automorphism.py +314 -0
- synkit/Graph/Matcher/batch_cluster.py +224 -0
- synkit/Graph/Matcher/dedup_matches.py +247 -0
- synkit/Graph/Matcher/graph_cluster.py +191 -0
- synkit/Graph/Matcher/graph_matcher.py +312 -0
- synkit/Graph/Matcher/graph_morphism.py +421 -0
- synkit/Graph/Matcher/mcs_matcher.py +804 -0
- synkit/Graph/Matcher/multi_turbo_iso.py +186 -0
- synkit/Graph/Matcher/orbit.py +284 -0
- synkit/Graph/Matcher/partial_matcher.py +694 -0
- synkit/Graph/Matcher/sing.py +544 -0
- synkit/Graph/Matcher/subgraph_matcher.py +812 -0
- synkit/Graph/Matcher/turbo_iso.py +272 -0
- synkit/Graph/Matcher/wl_sel.py +537 -0
- synkit/Graph/Mech/__init__.py +26 -0
- synkit/Graph/Mech/conversion.py +1466 -0
- synkit/Graph/Mech/conversion_debug.py +237 -0
- synkit/Graph/Mech/electron_accounting.py +200 -0
- synkit/Graph/Mech/lwg_editor.py +406 -0
- synkit/Graph/Mech/lwg_ops.py +313 -0
- synkit/Graph/Morphism/__init__.py +99 -0
- synkit/Graph/Morphism/constraints.py +460 -0
- synkit/Graph/Morphism/llg.py +999 -0
- synkit/Graph/Morphism/morphism.py +349 -0
- synkit/Graph/Morphism/stereo.py +258 -0
- synkit/Graph/Morphism/stereo_morphism.py +383 -0
- synkit/Graph/Morphism/stereo_morphism_helpers.py +957 -0
- synkit/Graph/Morphism/stereo_morphism_types.py +117 -0
- synkit/Graph/Stereo/__init__.py +376 -0
- synkit/Graph/Stereo/_descriptor_core.py +207 -0
- synkit/Graph/Stereo/_descriptor_serialization.py +138 -0
- synkit/Graph/Stereo/canonical.py +648 -0
- synkit/Graph/Stereo/changes.py +964 -0
- synkit/Graph/Stereo/composition.py +391 -0
- synkit/Graph/Stereo/configured.py +946 -0
- synkit/Graph/Stereo/couplings.py +245 -0
- synkit/Graph/Stereo/descriptors.py +1030 -0
- synkit/Graph/Stereo/enumeration.py +597 -0
- synkit/Graph/Stereo/extended_descriptors.py +406 -0
- synkit/Graph/Stereo/global_configured.py +152 -0
- synkit/Graph/Stereo/global_stereo.py +304 -0
- synkit/Graph/Stereo/identity.py +648 -0
- synkit/Graph/Stereo/interchange.py +496 -0
- synkit/Graph/Stereo/legacy.py +460 -0
- synkit/Graph/Stereo/matching.py +899 -0
- synkit/Graph/Stereo/native.py +154 -0
- synkit/Graph/Stereo/orbits.py +668 -0
- synkit/Graph/Stereo/outcomes.py +99 -0
- synkit/Graph/Stereo/pairwise.py +350 -0
- synkit/Graph/Stereo/rdkit_adapter.py +662 -0
- synkit/Graph/Stereo/rdkit_identity.py +118 -0
- synkit/Graph/Stereo/rdkit_resonance.py +140 -0
- synkit/Graph/Stereo/reaction_interchange.py +266 -0
- synkit/Graph/Stereo/semantics.py +296 -0
- synkit/Graph/Stereo/supports.py +257 -0
- synkit/Graph/Stereo/wire.py +339 -0
- synkit/Graph/Wildcard/__init__.py +0 -0
- synkit/Graph/Wildcard/fuse_graph.py +156 -0
- synkit/Graph/Wildcard/graph_wc.py +303 -0
- synkit/Graph/Wildcard/its_merge.py +857 -0
- synkit/Graph/Wildcard/radwc.py +114 -0
- synkit/Graph/Wildcard/wc_matcher.py +576 -0
- synkit/Graph/Wildcard/wildcard.py +225 -0
- synkit/Graph/__init__.py +17 -0
- synkit/Graph/canon_graph.py +14 -0
- synkit/Graph/syn_graph.py +199 -0
- synkit/Graph/utils.py +324 -0
- synkit/IO/__init__.py +4 -0
- synkit/IO/chem_converter.py +1059 -0
- synkit/IO/combinatorial/__init__.py +8 -0
- synkit/IO/combinatorial/gml_to_graph.py +223 -0
- synkit/IO/combinatorial/graph_to_gml.py +280 -0
- synkit/IO/combinatorial/graph_to_smarts.py +186 -0
- synkit/IO/combinatorial/smarts_expander.py +147 -0
- synkit/IO/combinatorial/smarts_generalizer.py +133 -0
- synkit/IO/combinatorial/smarts_to_graph.py +179 -0
- synkit/IO/conversion.py +42 -0
- synkit/IO/data_io.py +269 -0
- synkit/IO/data_process.py +143 -0
- synkit/IO/debug.py +73 -0
- synkit/IO/gml_to_nx.py +150 -0
- synkit/IO/graph_to_mol.py +199 -0
- synkit/IO/mol_to_graph.py +1105 -0
- synkit/IO/mol_to_graph_chemistry.py +545 -0
- synkit/IO/nx_to_gml.py +209 -0
- synkit/IO/smiles_to_id.py +123 -0
- synkit/Mechanism/__init__.py +151 -0
- synkit/Mechanism/adapters.py +136 -0
- synkit/Mechanism/audit.py +323 -0
- synkit/Mechanism/benchmark.py +638 -0
- synkit/Mechanism/compatibility.py +13 -0
- synkit/Mechanism/drawing.py +85 -0
- synkit/Mechanism/electron_models.py +725 -0
- synkit/Mechanism/equivalence.py +521 -0
- synkit/Mechanism/evidence.py +262 -0
- synkit/Mechanism/interchange.py +141 -0
- synkit/Mechanism/model.py +918 -0
- synkit/Mechanism/neighbor_stereo.py +312 -0
- synkit/Mechanism/radical_data.py +740 -0
- synkit/Mechanism/replay.py +986 -0
- synkit/Mechanism/schema.py +264 -0
- synkit/Mechanism/stereo_state.py +416 -0
- synkit/Mechanism/symbols.py +91 -0
- synkit/Rule/Apply/__init__.py +35 -0
- synkit/Rule/Apply/conditions.py +45 -0
- synkit/Rule/Apply/dpo.py +998 -0
- synkit/Rule/Apply/rule_matcher.py +218 -0
- synkit/Rule/Apply/validation.py +354 -0
- synkit/Rule/Compose/__init__.py +106 -0
- synkit/Rule/Compose/_identity.py +43 -0
- synkit/Rule/Compose/composition.py +976 -0
- synkit/Rule/Compose/laws.py +439 -0
- synkit/Rule/Compose/search.py +771 -0
- synkit/Rule/Compose/synrule.py +170 -0
- synkit/Rule/Modify/__init__.py +0 -0
- synkit/Rule/Modify/implict_rule.py +56 -0
- synkit/Rule/Modify/longest_path.py +92 -0
- synkit/Rule/Modify/molecule_rule.py +115 -0
- synkit/Rule/Modify/prune_templates.py +78 -0
- synkit/Rule/Modify/rule_utils.py +194 -0
- synkit/Rule/Modify/strip_rule.py +97 -0
- synkit/Rule/__init__.py +28 -0
- synkit/Rule/generic_stereo.py +884 -0
- synkit/Rule/stereo_identity.py +271 -0
- synkit/Rule/syn_rule.py +1090 -0
- synkit/Synthesis/MSR/__init__.py +0 -0
- synkit/Synthesis/MSR/path_finder.py +239 -0
- synkit/Synthesis/Metrics/__init__.py +0 -0
- synkit/Synthesis/Metrics/_base.py +52 -0
- synkit/Synthesis/Metrics/_plot.py +129 -0
- synkit/Synthesis/Metrics/_ranking.py +179 -0
- synkit/Synthesis/RBL/__init__.py +80 -0
- synkit/Synthesis/RBL/engine.py +1249 -0
- synkit/Synthesis/RBL/matching.py +652 -0
- synkit/Synthesis/RBL/overlap.py +336 -0
- synkit/Synthesis/RBL/pipeline.py +376 -0
- synkit/Synthesis/RBL/policy.py +139 -0
- synkit/Synthesis/RBL/proof.py +370 -0
- synkit/Synthesis/RBL/reaction.py +506 -0
- synkit/Synthesis/RBL/state.py +169 -0
- synkit/Synthesis/RBL/validation.py +1060 -0
- synkit/Synthesis/Reactor/__init__.py +60 -0
- synkit/Synthesis/Reactor/core/__init__.py +1 -0
- synkit/Synthesis/Reactor/core/engine.py +967 -0
- synkit/Synthesis/Reactor/core/product.py +621 -0
- synkit/Synthesis/Reactor/core/rewrite.py +561 -0
- synkit/Synthesis/Reactor/core/strategy.py +44 -0
- synkit/Synthesis/Reactor/matching/__init__.py +1 -0
- synkit/Synthesis/Reactor/matching/mixin.py +920 -0
- synkit/Synthesis/Reactor/matching/policy.py +345 -0
- synkit/Synthesis/Reactor/matching/symmetry.py +309 -0
- synkit/Synthesis/Reactor/output/__init__.py +1 -0
- synkit/Synthesis/Reactor/output/deduplication.py +703 -0
- synkit/Synthesis/Reactor/output/policy.py +16 -0
- synkit/Synthesis/Reactor/output/serialization.py +485 -0
- synkit/Synthesis/Reactor/output/structural.py +893 -0
- synkit/Synthesis/Reactor/stereo/__init__.py +1 -0
- synkit/Synthesis/Reactor/stereo/assignment.py +35 -0
- synkit/Synthesis/Reactor/stereo/mixin.py +780 -0
- synkit/Synthesis/Reactor/variants/__init__.py +1 -0
- synkit/Synthesis/Reactor/variants/imbalanced.py +180 -0
- synkit/Synthesis/Reactor/variants/partial.py +84 -0
- synkit/Synthesis/Reactor/workflow/__init__.py +1 -0
- synkit/Synthesis/Reactor/workflow/batch.py +550 -0
- synkit/Synthesis/Reactor/workflow/benchmark.py +143 -0
- synkit/Synthesis/Reactor/workflow/postprocess.py +267 -0
- synkit/Synthesis/Reactor/workflow/rule_filter.py +210 -0
- synkit/Synthesis/__init__.py +0 -0
- synkit/Synthesis/reactor_utils.py +316 -0
- synkit/Utils/__init__.py +0 -0
- synkit/Utils/utils.py +172 -0
- synkit/Vis/__init__.py +91 -0
- synkit/Vis/crn/__init__.py +40 -0
- synkit/Vis/epd/__init__.py +20 -0
- synkit/Vis/epd/arrows.py +425 -0
- synkit/Vis/epd/chem.py +197 -0
- synkit/Vis/epd/constants.py +83 -0
- synkit/Vis/epd/layout.py +283 -0
- synkit/Vis/epd/mapping.py +51 -0
- synkit/Vis/epd/models.py +136 -0
- synkit/Vis/epd/render.py +543 -0
- synkit/Vis/epd/utils.py +108 -0
- synkit/Vis/epd/visualizer.py +811 -0
- synkit/Vis/graph_visualizer.py +375 -0
- synkit/Vis/its/__init__.py +19 -0
- synkit/Vis/its/drawer.py +615 -0
- synkit/Vis/its_drawer.py +35 -0
- synkit/Vis/molecule/__init__.py +31 -0
- synkit/Vis/molecule/drawer.py +563 -0
- synkit/Vis/molecule/reaction.py +285 -0
- synkit/Vis/molecule_drawer.py +33 -0
- synkit/Vis/mtg/__init__.py +17 -0
- synkit/Vis/mtg/drawer.py +769 -0
- synkit/Vis/mtg_drawer.py +34 -0
- synkit/Vis/pdf_writer.py +146 -0
- synkit/Vis/reaction/__init__.py +19 -0
- synkit/Vis/reaction/rule.py +141 -0
- synkit/Vis/reaction/rxn.py +532 -0
- synkit/Vis/reaction_drawer.py +41 -0
- synkit/Vis/space/__init__.py +17 -0
- synkit/Vis/space/chemical.py +80 -0
- synkit/Vis/space/embedding.py +87 -0
- synkit/Vis/vis_synedu/Vis/__init__.py +7 -0
- synkit/Vis/vis_synedu/Vis/dpo.py +862 -0
- synkit/Vis/vis_synedu/rxn_vis.py +377 -0
- synkit/Vis/vis_synedu/vis.py +501 -0
- synkit/Vis/visual_drawer.py +215 -0
- synkit/Vis/visual_model.py +520 -0
- synkit/__init__.py +3 -0
- synkit/_native.py +91 -0
- synkit/examples.py +50 -0
- synkit/version.py +23 -0
- synkit-1.6.5.dist-info/METADATA +156 -0
- synkit-1.6.5.dist-info/RECORD +636 -0
- synkit-1.6.5.dist-info/WHEEL +4 -0
- synkit-1.6.5.dist-info/licenses/LICENSE +21 -0
- synkit-1.6.5.dist-info/licenses/synkit/Chem/Mapper/solvers/native/cpp/src/symmetry/vendor/nauty/COPYRIGHT +44 -0
- synkit-1.6.5.dist-info/licenses/synkit/Chem/Mapper/solvers/native/cpp/src/symmetry/vendor/nauty/LICENSE-2.0.txt +202 -0
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
// Exact minimal siphon/trap models: implication propagation and closure minimization.
|
|
2
|
+
#include <algorithm>
|
|
3
|
+
#include <chrono>
|
|
4
|
+
#include <cmath>
|
|
5
|
+
#include <cstdint>
|
|
6
|
+
#include <cstdlib>
|
|
7
|
+
#include <cstring>
|
|
8
|
+
#include <sstream>
|
|
9
|
+
#include <string>
|
|
10
|
+
#include <unordered_set>
|
|
11
|
+
#include <vector>
|
|
12
|
+
namespace {
|
|
13
|
+
using Mask = std::vector<std::uint64_t>;
|
|
14
|
+
using Clock = std::chrono::steady_clock;
|
|
15
|
+
struct Limit { const char* reason; };
|
|
16
|
+
struct Hash {
|
|
17
|
+
std::size_t operator()(const Mask& mask) const {
|
|
18
|
+
std::size_t h=0;
|
|
19
|
+
for (auto w: mask) h ^= std::hash<std::uint64_t>{}(w)+0x9e3779b9+(h<<6)+(h>>2);
|
|
20
|
+
return h;
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
struct Search {
|
|
24
|
+
std::size_t n, words, transitions;
|
|
25
|
+
const std::uint64_t* trigger;
|
|
26
|
+
const std::uint64_t* required;
|
|
27
|
+
Clock::time_point deadline;
|
|
28
|
+
void check() const { if (deadline != Clock::time_point::max() && Clock::now() >= deadline) throw Limit{"time_limit"}; }
|
|
29
|
+
static bool nonempty(const Mask& mask) {
|
|
30
|
+
return std::any_of(mask.begin(), mask.end(), [](std::uint64_t w){return w!=0;});
|
|
31
|
+
}
|
|
32
|
+
Mask closure(Mask current) const {
|
|
33
|
+
bool changed=true;
|
|
34
|
+
while (changed) {
|
|
35
|
+
check(); changed=false;
|
|
36
|
+
for (std::size_t t=0; t<transitions; ++t) {
|
|
37
|
+
if ((t & 127) == 0) check();
|
|
38
|
+
bool hit=false, satisfied=false;
|
|
39
|
+
for (std::size_t w=0; w<words; ++w) {
|
|
40
|
+
hit |= bool(trigger[t*words+w] & current[w]);
|
|
41
|
+
satisfied |= bool(required[t*words+w] & current[w]);
|
|
42
|
+
}
|
|
43
|
+
if (hit && !satisfied) {
|
|
44
|
+
for (std::size_t w=0; w<words; ++w) current[w] &= ~trigger[t*words+w];
|
|
45
|
+
changed=true;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
return current;
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
extern "C" {
|
|
54
|
+
int synkit_crn_structural_abi() { return 2; }
|
|
55
|
+
int synkit_crn_structural_sets(std::size_t n, std::size_t transitions,
|
|
56
|
+
const std::uint64_t* trigger, const std::uint64_t* required,
|
|
57
|
+
double seconds, std::uint64_t max_nodes, std::size_t max_results,
|
|
58
|
+
char** output) {
|
|
59
|
+
if (!output || !std::isfinite(seconds) || seconds < 0 || seconds > 1e9) return 2;
|
|
60
|
+
*output=nullptr;
|
|
61
|
+
Search search{n, (n+63)/64, transitions, trigger, required,
|
|
62
|
+
seconds == 0 ? Clock::time_point::max() :
|
|
63
|
+
Clock::now()+std::chrono::duration_cast<Clock::duration>(std::chrono::duration<double>(seconds))};
|
|
64
|
+
struct State { Mask selected, excluded; };
|
|
65
|
+
std::vector<Mask> results;
|
|
66
|
+
std::unordered_set<Mask,Hash> emitted;
|
|
67
|
+
std::uint64_t evaluations=0, states=0, closures=0;
|
|
68
|
+
std::size_t peak=0;
|
|
69
|
+
const char* reason="complete";
|
|
70
|
+
auto tick = [&]() {
|
|
71
|
+
search.check();
|
|
72
|
+
if (max_nodes && evaluations>=max_nodes) throw Limit{"node_limit"};
|
|
73
|
+
++evaluations;
|
|
74
|
+
};
|
|
75
|
+
auto count = [](const Mask& mask) {
|
|
76
|
+
std::size_t total=0;
|
|
77
|
+
for (auto word: mask) {
|
|
78
|
+
#if defined(__GNUC__) || defined(__clang__)
|
|
79
|
+
total += __builtin_popcountll(word);
|
|
80
|
+
#else
|
|
81
|
+
while (word) { word &= word - 1; ++total; }
|
|
82
|
+
#endif
|
|
83
|
+
}
|
|
84
|
+
return total;
|
|
85
|
+
};
|
|
86
|
+
try {
|
|
87
|
+
// Each minimal model has one least selected species. These roots and
|
|
88
|
+
// the ordered positive/negative branches partition the model space.
|
|
89
|
+
for (std::size_t seed=0; seed<n; ++seed) {
|
|
90
|
+
State root{Mask(search.words,0),Mask(search.words,0)};
|
|
91
|
+
root.selected[seed/64] |= std::uint64_t(1)<<(seed%64);
|
|
92
|
+
for (std::size_t p=0; p<seed; ++p)
|
|
93
|
+
root.excluded[p/64] |= std::uint64_t(1)<<(p%64);
|
|
94
|
+
std::vector<State> stack;
|
|
95
|
+
stack.push_back(std::move(root));
|
|
96
|
+
while (!stack.empty()) {
|
|
97
|
+
tick(); ++states;
|
|
98
|
+
State current=std::move(stack.back()); stack.pop_back();
|
|
99
|
+
bool conflict=false, changed=true;
|
|
100
|
+
while (changed && !conflict) {
|
|
101
|
+
search.check(); changed=false;
|
|
102
|
+
// An emitted minimal model blocks every strict superset.
|
|
103
|
+
for (const auto& known: results) {
|
|
104
|
+
bool blocked=false;
|
|
105
|
+
Mask missing(search.words,0);
|
|
106
|
+
for (std::size_t w=0; w<search.words; ++w) {
|
|
107
|
+
blocked |= bool(known[w] & current.excluded[w]);
|
|
108
|
+
missing[w] = known[w] & ~current.selected[w];
|
|
109
|
+
}
|
|
110
|
+
if (blocked) continue;
|
|
111
|
+
auto remaining=count(missing);
|
|
112
|
+
if (!remaining) { conflict=true; break; }
|
|
113
|
+
if (remaining==1) {
|
|
114
|
+
for (std::size_t w=0; w<search.words; ++w) {
|
|
115
|
+
auto next=current.excluded[w] | missing[w];
|
|
116
|
+
changed |= next != current.excluded[w];
|
|
117
|
+
current.excluded[w]=next;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
if (conflict) break;
|
|
122
|
+
for (std::size_t t=0; t<transitions; ++t) {
|
|
123
|
+
if ((t & 127)==0) search.check();
|
|
124
|
+
bool hit=false, satisfied=false;
|
|
125
|
+
Mask choices(search.words,0);
|
|
126
|
+
for (std::size_t w=0; w<search.words; ++w) {
|
|
127
|
+
hit |= bool(trigger[t*search.words+w] & current.selected[w]);
|
|
128
|
+
satisfied |= bool(required[t*search.words+w] & current.selected[w]);
|
|
129
|
+
choices[w]=required[t*search.words+w] & ~current.excluded[w];
|
|
130
|
+
}
|
|
131
|
+
if (satisfied) continue;
|
|
132
|
+
auto available=count(choices);
|
|
133
|
+
if (!available) {
|
|
134
|
+
for (std::size_t w=0; w<search.words; ++w) {
|
|
135
|
+
auto next=current.excluded[w] | trigger[t*search.words+w];
|
|
136
|
+
changed |= next != current.excluded[w];
|
|
137
|
+
current.excluded[w]=next;
|
|
138
|
+
}
|
|
139
|
+
} else if (hit && available==1) {
|
|
140
|
+
for (std::size_t w=0; w<search.words; ++w) {
|
|
141
|
+
auto next=current.selected[w] | choices[w];
|
|
142
|
+
changed |= next != current.selected[w];
|
|
143
|
+
current.selected[w]=next;
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
for (std::size_t w=0; w<search.words; ++w)
|
|
148
|
+
conflict |= bool(current.selected[w] & current.excluded[w]);
|
|
149
|
+
}
|
|
150
|
+
if (conflict) continue;
|
|
151
|
+
Mask choices(search.words,0);
|
|
152
|
+
bool needs_branch=false;
|
|
153
|
+
std::size_t best=n+1;
|
|
154
|
+
for (std::size_t t=0; t<transitions; ++t) {
|
|
155
|
+
bool hit=false, satisfied=false;
|
|
156
|
+
Mask available(search.words,0);
|
|
157
|
+
for (std::size_t w=0; w<search.words; ++w) {
|
|
158
|
+
hit |= bool(trigger[t*search.words+w] & current.selected[w]);
|
|
159
|
+
satisfied |= bool(required[t*search.words+w] & current.selected[w]);
|
|
160
|
+
available[w]=required[t*search.words+w] & ~current.excluded[w];
|
|
161
|
+
}
|
|
162
|
+
if (hit && !satisfied && count(available)<best) {
|
|
163
|
+
choices=std::move(available); best=count(choices); needs_branch=true;
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
if (!needs_branch) {
|
|
167
|
+
Mask minimal=current.selected;
|
|
168
|
+
for (std::size_t p=0; p<n; ++p) {
|
|
169
|
+
if (!(minimal[p/64] & (std::uint64_t(1)<<(p%64)))) continue;
|
|
170
|
+
tick(); ++closures;
|
|
171
|
+
Mask child=minimal;
|
|
172
|
+
child[p/64] &= ~(std::uint64_t(1)<<(p%64));
|
|
173
|
+
child=search.closure(std::move(child));
|
|
174
|
+
if (Search::nonempty(child)) minimal=std::move(child);
|
|
175
|
+
}
|
|
176
|
+
if (emitted.insert(minimal).second) results.push_back(std::move(minimal));
|
|
177
|
+
if (max_results && results.size()>=max_results &&
|
|
178
|
+
(!stack.empty() || seed+1<n)) throw Limit{"result_limit"};
|
|
179
|
+
} else {
|
|
180
|
+
// Choose one required member; earlier choices are false
|
|
181
|
+
// in later alternatives, avoiding redundant unions.
|
|
182
|
+
for (std::size_t p=0; p<n; ++p) {
|
|
183
|
+
auto bit=std::uint64_t(1)<<(p%64);
|
|
184
|
+
if (!(choices[p/64] & bit)) continue;
|
|
185
|
+
State child=current;
|
|
186
|
+
child.selected[p/64] |= bit;
|
|
187
|
+
stack.push_back(std::move(child));
|
|
188
|
+
current.excluded[p/64] |= bit;
|
|
189
|
+
}
|
|
190
|
+
peak=std::max(peak,stack.size());
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
} catch (const Limit& limit) { reason=limit.reason; }
|
|
195
|
+
catch (const std::bad_alloc&) { reason="allocation_failure"; }
|
|
196
|
+
catch (...) { return 2; }
|
|
197
|
+
try {
|
|
198
|
+
std::ostringstream out;
|
|
199
|
+
out << "{\"termination_reason\":\"" << reason
|
|
200
|
+
<< "\",\"algorithm\":\"implication propagation and closure minimization\""
|
|
201
|
+
<< ",\"search_evaluations\":" << evaluations
|
|
202
|
+
<< ",\"states_explored\":" << states
|
|
203
|
+
<< ",\"closure_evaluations\":" << closures
|
|
204
|
+
<< ",\"peak_frontier\":" << peak << ",\"sets\":[";
|
|
205
|
+
for (std::size_t r=0; r<results.size(); ++r) {
|
|
206
|
+
if (r) out << ',';
|
|
207
|
+
out << '['; bool first=true;
|
|
208
|
+
for (std::size_t p=0; p<n; ++p) if (results[r][p/64] & (std::uint64_t(1)<<(p%64))) {
|
|
209
|
+
if (!first) out << ',';
|
|
210
|
+
first=false; out << p;
|
|
211
|
+
}
|
|
212
|
+
out << ']';
|
|
213
|
+
}
|
|
214
|
+
out << "]}";
|
|
215
|
+
auto text=out.str();
|
|
216
|
+
auto* buffer=static_cast<char*>(std::malloc(text.size()+1));
|
|
217
|
+
if (!buffer) return 2;
|
|
218
|
+
std::memcpy(buffer,text.c_str(),text.size()+1); *output=buffer;
|
|
219
|
+
return 0;
|
|
220
|
+
} catch (...) { return 2; }
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
extern "C" int synkit_crn_exhaustive_siphons(std::size_t n,std::size_t transitions,
|
|
225
|
+
const std::uint64_t* pre,const std::uint64_t* post,double seconds,char** output){
|
|
226
|
+
if(!output||n>24||!std::isfinite(seconds)||seconds<=0||seconds>1e9)return 2;
|
|
227
|
+
*output=nullptr;auto deadline=Clock::now()+std::chrono::duration_cast<Clock::duration>(std::chrono::duration<double>(seconds));
|
|
228
|
+
std::vector<std::uint64_t> minimal;const char* reason="complete";std::uint64_t inspected=0;
|
|
229
|
+
try{
|
|
230
|
+
for(std::uint64_t mask=1;mask<(std::uint64_t(1)<<n);++mask){
|
|
231
|
+
if(Clock::now()>=deadline)throw Limit{"time_limit"};++inspected;bool valid=true;
|
|
232
|
+
for(std::size_t t=0;t<transitions;++t)if((post[t]&mask) && !(pre[t]&mask)){valid=false;break;}
|
|
233
|
+
if(!valid)continue;bool dominated=false;for(auto m:minimal)if((m&mask)==m){dominated=true;break;}
|
|
234
|
+
if(!dominated)minimal.push_back(mask);
|
|
235
|
+
}
|
|
236
|
+
}catch(const Limit& l){reason=l.reason;}catch(...){return 2;}
|
|
237
|
+
std::ostringstream out;out<<"{\"termination_reason\":\""<<reason<<"\",\"subsets\":"<<inspected<<",\"sets\":[";
|
|
238
|
+
for(std::size_t r=0;r<minimal.size();++r){if(r)out<<',';out<<'[';bool first=true;for(std::size_t i=0;i<n;++i)if(minimal[r]&(std::uint64_t(1)<<i)){if(!first)out<<',';first=false;out<<i;}out<<']';}out<<"]}";
|
|
239
|
+
auto text=out.str();auto* buffer=static_cast<char*>(std::malloc(text.size()+1));if(!buffer)return 2;std::memcpy(buffer,text.c_str(),text.size()+1);*output=buffer;return 0;
|
|
240
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
#include "exact.h"
|
|
2
|
+
#include <map>
|
|
3
|
+
#include <numeric>
|
|
4
|
+
#include <functional>
|
|
5
|
+
using namespace crn_exact;
|
|
6
|
+
extern "C" {
|
|
7
|
+
int synkit_crn_symmetry_abi(){return 1;}
|
|
8
|
+
int synkit_crn_symmetry(std::size_t n,const std::int64_t* kinds,const std::int64_t* adjacency,
|
|
9
|
+
double seconds,std::size_t max_states,std::size_t max_count,char** output){
|
|
10
|
+
if(!output||!std::isfinite(seconds)||seconds<=0||seconds>1e9||!max_states||!max_count)return 2;*output=nullptr;Budget budget(seconds);
|
|
11
|
+
std::size_t states=0;Int count=0;std::vector<std::int64_t> best;std::vector<std::size_t> base,parent(n);std::iota(parent.begin(),parent.end(),0);
|
|
12
|
+
std::vector<std::vector<std::pair<std::size_t,std::int64_t>>> incoming(n),outgoing(n);
|
|
13
|
+
auto find=[&](std::size_t v){while(parent[v]!=v)v=parent[v];return v;};const char* reason="complete";
|
|
14
|
+
try{
|
|
15
|
+
for(std::size_t i=0;i<n;++i){budget.check();for(std::size_t j=0;j<n;++j)if(adjacency[i*n+j]){outgoing[i].push_back({j,adjacency[i*n+j]});incoming[j].push_back({i,adjacency[i*n+j]});}}
|
|
16
|
+
auto refine=[&](std::vector<std::int64_t> colors){
|
|
17
|
+
while(true){budget.check();std::vector<std::vector<std::int64_t>> signatures(n);std::map<std::vector<std::int64_t>,std::int64_t> ids;
|
|
18
|
+
for(std::size_t v=0;v<n;++v){auto& sig=signatures[v];sig.push_back(colors[v]);
|
|
19
|
+
for(auto* edges:{&incoming[v],&outgoing[v]}){std::vector<std::pair<std::int64_t,std::int64_t>> neighbors;for(auto edge:*edges)neighbors.push_back({colors[edge.first],edge.second});std::sort(neighbors.begin(),neighbors.end());sig.push_back(neighbors.size());for(auto pair:neighbors){sig.push_back(pair.first);sig.push_back(pair.second);}}
|
|
20
|
+
ids.emplace(sig,0);}
|
|
21
|
+
std::int64_t id=0;for(auto& entry:ids)entry.second=id++;
|
|
22
|
+
std::vector<std::int64_t> next;for(const auto& sig:signatures)next.push_back(ids[sig]);if(next==colors)return colors;colors=std::move(next);
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
std::function<void(std::vector<std::int64_t>)> visit=[&](std::vector<std::int64_t> colors){
|
|
26
|
+
budget.check();if(states>=max_states)throw Limit{"state_limit"};++states;colors=refine(std::move(colors));
|
|
27
|
+
std::map<std::int64_t,std::vector<std::size_t>> cells;for(std::size_t v=0;v<n;++v)cells[colors[v]].push_back(v);
|
|
28
|
+
std::vector<std::size_t> selected;for(const auto& entry:cells)if(entry.second.size()>1 && (selected.empty()||entry.second.size()<selected.size()))selected=entry.second;
|
|
29
|
+
if(!selected.empty()){
|
|
30
|
+
auto fresh=*std::max_element(colors.begin(),colors.end())+1;for(auto v:selected){auto next=colors;next[v]=fresh;visit(std::move(next));}return;
|
|
31
|
+
}
|
|
32
|
+
std::vector<std::size_t> order;for(const auto& entry:cells)order.push_back(entry.second[0]);
|
|
33
|
+
std::vector<std::int64_t> certificate;certificate.reserve(n+n*n);
|
|
34
|
+
for(auto v:order)certificate.push_back(kinds[v]);for(auto v:order)for(auto w:order)certificate.push_back(adjacency[v*n+w]);
|
|
35
|
+
if(base.empty() || certificate<best){best=std::move(certificate);base=order;count=1;std::iota(parent.begin(),parent.end(),0);}
|
|
36
|
+
else if(certificate==best){++count;for(std::size_t i=0;i<n;++i){auto a=find(base[i]),b=find(order[i]);if(a!=b)parent[b]=a;}}
|
|
37
|
+
if(count>=max_count)throw Limit{"count_limit"};
|
|
38
|
+
};
|
|
39
|
+
std::vector<std::int64_t> initial(kinds,kinds+n);visit(std::move(initial));
|
|
40
|
+
}catch(const Limit& limit){reason=limit.reason;}catch(const std::bad_alloc&){reason="allocation_failure";}catch(...){return 2;}
|
|
41
|
+
std::map<std::size_t,std::vector<std::size_t>> orbits;for(std::size_t v=0;v<n;++v)orbits[find(v)].push_back(v);
|
|
42
|
+
std::vector<std::vector<std::size_t>> groups;for(auto entry:orbits)groups.push_back(std::move(entry.second));
|
|
43
|
+
std::ostringstream out;out<<"{\"termination_reason\":\""<<reason<<"\",\"states\":"<<states<<",\"automorphism_count\":"<<count<<",\"order\":";vector_json(out,base);out<<",\"orbits\":";matrix_json(out,groups);out<<'}';return output_json(out.str(),output);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# A CMake-built CRN library has the same sidecar contract as build_native().
|
|
2
|
+
file(READ "${BUILD_METADATA}" metadata)
|
|
3
|
+
string(JSON metadata SET "${metadata}" abi 1)
|
|
4
|
+
if(EXACT_ENABLED)
|
|
5
|
+
string(JSON metadata SET "${metadata}" semiflows_abi 1)
|
|
6
|
+
string(JSON metadata SET "${metadata}" capabilities
|
|
7
|
+
"[\"closure\",\"structural_sets\",\"structural_unlimited\",\"exhaustive_siphons\",\"exact_semiflows\",\"exact_algebra\",\"crnt\",\"pathway\",\"symmetry\"]")
|
|
8
|
+
else()
|
|
9
|
+
string(JSON metadata SET "${metadata}" semiflows_abi null)
|
|
10
|
+
string(JSON metadata SET "${metadata}" capabilities
|
|
11
|
+
"[\"closure\",\"structural_sets\",\"structural_unlimited\",\"exhaustive_siphons\"]")
|
|
12
|
+
endif()
|
|
13
|
+
string(JSON metadata SET "${metadata}" source_sha256 "{}")
|
|
14
|
+
file(GLOB sources
|
|
15
|
+
"${SOURCE_DIR}/*.cpp" "${SOURCE_DIR}/*.h"
|
|
16
|
+
"${SOURCE_DIR}/*.cmake" "${SOURCE_DIR}/CMakeLists.txt")
|
|
17
|
+
foreach(source IN LISTS sources)
|
|
18
|
+
file(SHA256 "${source}" digest)
|
|
19
|
+
get_filename_component(name "${source}" NAME)
|
|
20
|
+
string(JSON metadata SET "${metadata}" source_sha256 "${name}" "\"${digest}\"")
|
|
21
|
+
endforeach()
|
|
22
|
+
string(SHA256 digest "${metadata}")
|
|
23
|
+
string(JSON metadata SET "${metadata}" build_sha256 "\"${digest}\"")
|
|
24
|
+
file(SHA256 "${LIBRARY_FILE}" digest)
|
|
25
|
+
string(JSON metadata SET "${metadata}" library_sha256 "\"${digest}\"")
|
|
26
|
+
get_filename_component(directory "${LIBRARY_FILE}" DIRECTORY)
|
|
27
|
+
get_filename_component(stem "${LIBRARY_FILE}" NAME_WE)
|
|
28
|
+
file(WRITE "${directory}/${stem}.json" "${metadata}\n")
|
synkit/CRN/kinds.py
ADDED
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
"""Shared node-kind vocabulary for SynKit-CRN bipartite graphs.
|
|
2
|
+
|
|
3
|
+
Every SynKit CRN graph is bipartite over *species* nodes and *reaction* nodes.
|
|
4
|
+
Historically the two halves of the package disagreed about how a reaction node
|
|
5
|
+
is spelled: the rule-expansion builder emits ``kind="rule"`` (a concrete rule
|
|
6
|
+
application), while :meth:`SynCRN.from_digraph` also accepts and round-trips
|
|
7
|
+
``kind="reaction"``. Modules that hard-coded a single spelling silently ignored
|
|
8
|
+
the other, producing empty stoichiometric matrices rather than an error.
|
|
9
|
+
|
|
10
|
+
This module is the single source of truth. Any code that classifies CRN graph
|
|
11
|
+
nodes must use :func:`is_species_node` and :func:`is_reaction_node` rather than
|
|
12
|
+
comparing the ``kind`` attribute directly.
|
|
13
|
+
|
|
14
|
+
.. rubric:: Example
|
|
15
|
+
|
|
16
|
+
.. code-block:: python
|
|
17
|
+
|
|
18
|
+
from synkit.CRN.kinds import is_reaction_node, REACTION_KINDS
|
|
19
|
+
|
|
20
|
+
print(sorted(REACTION_KINDS))
|
|
21
|
+
print(is_reaction_node({"kind": "reaction"}))
|
|
22
|
+
print(is_reaction_node({"kind": "rule"}))
|
|
23
|
+
"""
|
|
24
|
+
|
|
25
|
+
from __future__ import annotations
|
|
26
|
+
|
|
27
|
+
from typing import Any, Mapping
|
|
28
|
+
|
|
29
|
+
__all__ = [
|
|
30
|
+
"KIND_ATTR",
|
|
31
|
+
"SPECIES_KIND",
|
|
32
|
+
"REACTION_KIND",
|
|
33
|
+
"RULE_KIND",
|
|
34
|
+
"SPECIES_KINDS",
|
|
35
|
+
"REACTION_KINDS",
|
|
36
|
+
"ALL_KINDS",
|
|
37
|
+
"node_kind",
|
|
38
|
+
"is_species_node",
|
|
39
|
+
"is_reaction_node",
|
|
40
|
+
]
|
|
41
|
+
|
|
42
|
+
#: Node attribute holding the kind discriminator.
|
|
43
|
+
KIND_ATTR = "kind"
|
|
44
|
+
|
|
45
|
+
#: Canonical spelling for species nodes.
|
|
46
|
+
SPECIES_KIND = "species"
|
|
47
|
+
|
|
48
|
+
#: Canonical spelling for reaction nodes.
|
|
49
|
+
REACTION_KIND = "reaction"
|
|
50
|
+
|
|
51
|
+
#: Legacy spelling for a concrete rule application, still emitted by
|
|
52
|
+
#: :class:`~synkit.CRN.Construct.builder.CRNExpand` and preserved on round-trip.
|
|
53
|
+
RULE_KIND = "rule"
|
|
54
|
+
|
|
55
|
+
#: All accepted spellings for species nodes.
|
|
56
|
+
SPECIES_KINDS = frozenset({SPECIES_KIND})
|
|
57
|
+
|
|
58
|
+
#: All accepted spellings for reaction nodes.
|
|
59
|
+
#:
|
|
60
|
+
#: ``"rule"`` denotes a concrete reaction instance produced by applying a rule;
|
|
61
|
+
#: it is *not* an abstract rule template. Abstract rules live in
|
|
62
|
+
#: :class:`~synkit.CRN.Structure.rule.Rule` records and never become graph nodes.
|
|
63
|
+
REACTION_KINDS = frozenset({REACTION_KIND, RULE_KIND})
|
|
64
|
+
|
|
65
|
+
#: Every node kind recognised anywhere in the CRN package.
|
|
66
|
+
ALL_KINDS = SPECIES_KINDS | REACTION_KINDS
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
def node_kind(data: Mapping[str, Any]) -> str:
|
|
70
|
+
"""Return the normalized node kind for a node-attribute mapping.
|
|
71
|
+
|
|
72
|
+
The value is lower-cased and stripped so that ``"Rule"``, ``" rule "`` and
|
|
73
|
+
``"rule"`` compare equal. A missing ``kind`` yields the empty string.
|
|
74
|
+
|
|
75
|
+
:param data:
|
|
76
|
+
Node attribute mapping.
|
|
77
|
+
:type data: Mapping[str, Any]
|
|
78
|
+
|
|
79
|
+
:return:
|
|
80
|
+
Normalized kind string, or ``""`` when absent.
|
|
81
|
+
:rtype: str
|
|
82
|
+
|
|
83
|
+
.. rubric:: Example
|
|
84
|
+
|
|
85
|
+
.. code-block:: python
|
|
86
|
+
|
|
87
|
+
node_kind({"kind": " Rule "})
|
|
88
|
+
# 'rule'
|
|
89
|
+
"""
|
|
90
|
+
return str(data.get(KIND_ATTR, "")).strip().lower()
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
def is_species_node(data: Mapping[str, Any]) -> bool:
|
|
94
|
+
"""Return whether a node-attribute mapping describes a species node.
|
|
95
|
+
|
|
96
|
+
:param data:
|
|
97
|
+
Node attribute mapping.
|
|
98
|
+
:type data: Mapping[str, Any]
|
|
99
|
+
|
|
100
|
+
:return:
|
|
101
|
+
``True`` when the node is a species node.
|
|
102
|
+
:rtype: bool
|
|
103
|
+
|
|
104
|
+
.. rubric:: Example
|
|
105
|
+
|
|
106
|
+
.. code-block:: python
|
|
107
|
+
|
|
108
|
+
is_species_node({"kind": "species"})
|
|
109
|
+
# True
|
|
110
|
+
"""
|
|
111
|
+
return node_kind(data) in SPECIES_KINDS
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
def is_reaction_node(data: Mapping[str, Any]) -> bool:
|
|
115
|
+
"""Return whether a node-attribute mapping describes a reaction node.
|
|
116
|
+
|
|
117
|
+
Both ``kind="reaction"`` and the legacy ``kind="rule"`` are accepted, since
|
|
118
|
+
both denote a concrete reaction instance.
|
|
119
|
+
|
|
120
|
+
:param data:
|
|
121
|
+
Node attribute mapping.
|
|
122
|
+
:type data: Mapping[str, Any]
|
|
123
|
+
|
|
124
|
+
:return:
|
|
125
|
+
``True`` when the node is a reaction node.
|
|
126
|
+
:rtype: bool
|
|
127
|
+
|
|
128
|
+
.. rubric:: Example
|
|
129
|
+
|
|
130
|
+
.. code-block:: python
|
|
131
|
+
|
|
132
|
+
is_reaction_node({"kind": "rule"})
|
|
133
|
+
# True
|
|
134
|
+
is_reaction_node({"kind": "reaction"})
|
|
135
|
+
# True
|
|
136
|
+
"""
|
|
137
|
+
return node_kind(data) in REACTION_KINDS
|
|
Binary file
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
{
|
|
2
|
+
"abi": 1,
|
|
3
|
+
"boost_version": 109200,
|
|
4
|
+
"build_sha256": "717100ca1a049cb769983ed578544a9b585a077c598848631e317bdbaf4eab85",
|
|
5
|
+
"capabilities": [
|
|
6
|
+
"closure",
|
|
7
|
+
"structural_sets",
|
|
8
|
+
"structural_unlimited",
|
|
9
|
+
"exhaustive_siphons",
|
|
10
|
+
"exact_semiflows",
|
|
11
|
+
"exact_algebra",
|
|
12
|
+
"crnt",
|
|
13
|
+
"pathway",
|
|
14
|
+
"symmetry"
|
|
15
|
+
],
|
|
16
|
+
"compiler": "MSVC 19.51.36260.0",
|
|
17
|
+
"compiler_path": "C:/Program Files/Microsoft Visual Studio/18/Enterprise/VC/Tools/MSVC/14.51.36231/bin/Hostx64/x64/cl.exe",
|
|
18
|
+
"integrity": "wheel-record",
|
|
19
|
+
"platform": "win-amd64",
|
|
20
|
+
"root_cmake_sha256": "2c1433ff868633931a01066207978428cc29bb01660ae206d56458a62523f776",
|
|
21
|
+
"semiflows_abi": 1,
|
|
22
|
+
"source_sha256": {
|
|
23
|
+
"CMakeLists.txt": "3dec4ad1a8192f019329dd99629f8f80dc84ac7440de512ee7686111b33ceff5",
|
|
24
|
+
"algebra.cpp": "cbbbd7d54fe4f6816dbd61a4f1516facf69b3e560660099cb0c37f2724dcf5bb",
|
|
25
|
+
"closure.cpp": "135e14d375b161975e2363953f98195c180cff46bf1fb53100f5ff027e08ce18",
|
|
26
|
+
"exact.h": "31c4225e7636e468237b3d547fc546972b662bffc8a0f09ec0d877aec5d41462",
|
|
27
|
+
"pathway.cpp": "b06604694b97f398c982557d55d46161951cafe2feac9034ec39a73733bbf7b7",
|
|
28
|
+
"semiflows.cpp": "cf677624f399f45a4c62e5eaf4a2e29b2748de5edef6da82e006ccea87fb45c4",
|
|
29
|
+
"structural.cpp": "8ca653e5ce396ecab494740ee14f848927ceced1bcad4fbcdc2183166a39d06e",
|
|
30
|
+
"symmetry.cpp": "d5a14d49396d51f64a210784afb26ff8bad1b57241652d1dbfc67ebb8a268df0",
|
|
31
|
+
"write_manifest.cmake": "2b58e875b7c2719331375762013abff18ebc968cc7c61489439b69baced7d799"
|
|
32
|
+
}
|
|
33
|
+
}
|