molbuilder 1.0.0__py3-none-any.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.
Files changed (78) hide show
  1. molbuilder/__init__.py +8 -0
  2. molbuilder/__main__.py +6 -0
  3. molbuilder/atomic/__init__.py +4 -0
  4. molbuilder/atomic/bohr.py +235 -0
  5. molbuilder/atomic/quantum_atom.py +334 -0
  6. molbuilder/atomic/quantum_numbers.py +196 -0
  7. molbuilder/atomic/wavefunctions.py +297 -0
  8. molbuilder/bonding/__init__.py +4 -0
  9. molbuilder/bonding/covalent.py +442 -0
  10. molbuilder/bonding/lewis.py +347 -0
  11. molbuilder/bonding/vsepr.py +433 -0
  12. molbuilder/cli/__init__.py +1 -0
  13. molbuilder/cli/demos.py +516 -0
  14. molbuilder/cli/menu.py +127 -0
  15. molbuilder/cli/wizard.py +831 -0
  16. molbuilder/core/__init__.py +6 -0
  17. molbuilder/core/bond_data.py +170 -0
  18. molbuilder/core/constants.py +51 -0
  19. molbuilder/core/element_properties.py +183 -0
  20. molbuilder/core/elements.py +181 -0
  21. molbuilder/core/geometry.py +232 -0
  22. molbuilder/gui/__init__.py +2 -0
  23. molbuilder/gui/app.py +286 -0
  24. molbuilder/gui/canvas3d.py +115 -0
  25. molbuilder/gui/dialogs.py +117 -0
  26. molbuilder/gui/event_handler.py +118 -0
  27. molbuilder/gui/sidebar.py +105 -0
  28. molbuilder/gui/toolbar.py +71 -0
  29. molbuilder/io/__init__.py +1 -0
  30. molbuilder/io/json_io.py +146 -0
  31. molbuilder/io/mol_sdf.py +169 -0
  32. molbuilder/io/pdb.py +184 -0
  33. molbuilder/io/smiles_io.py +47 -0
  34. molbuilder/io/xyz.py +103 -0
  35. molbuilder/molecule/__init__.py +2 -0
  36. molbuilder/molecule/amino_acids.py +919 -0
  37. molbuilder/molecule/builders.py +257 -0
  38. molbuilder/molecule/conformations.py +70 -0
  39. molbuilder/molecule/functional_groups.py +484 -0
  40. molbuilder/molecule/graph.py +712 -0
  41. molbuilder/molecule/peptides.py +13 -0
  42. molbuilder/molecule/stereochemistry.py +6 -0
  43. molbuilder/process/__init__.py +3 -0
  44. molbuilder/process/conditions.py +260 -0
  45. molbuilder/process/costing.py +316 -0
  46. molbuilder/process/purification.py +285 -0
  47. molbuilder/process/reactor.py +297 -0
  48. molbuilder/process/safety.py +476 -0
  49. molbuilder/process/scale_up.py +427 -0
  50. molbuilder/process/solvent_systems.py +204 -0
  51. molbuilder/reactions/__init__.py +3 -0
  52. molbuilder/reactions/functional_group_detect.py +728 -0
  53. molbuilder/reactions/knowledge_base.py +1716 -0
  54. molbuilder/reactions/reaction_types.py +102 -0
  55. molbuilder/reactions/reagent_data.py +1248 -0
  56. molbuilder/reactions/retrosynthesis.py +1430 -0
  57. molbuilder/reactions/synthesis_route.py +377 -0
  58. molbuilder/reports/__init__.py +158 -0
  59. molbuilder/reports/cost_report.py +206 -0
  60. molbuilder/reports/molecule_report.py +279 -0
  61. molbuilder/reports/safety_report.py +296 -0
  62. molbuilder/reports/synthesis_report.py +283 -0
  63. molbuilder/reports/text_formatter.py +170 -0
  64. molbuilder/smiles/__init__.py +4 -0
  65. molbuilder/smiles/parser.py +487 -0
  66. molbuilder/smiles/tokenizer.py +291 -0
  67. molbuilder/smiles/writer.py +375 -0
  68. molbuilder/visualization/__init__.py +1 -0
  69. molbuilder/visualization/bohr_viz.py +166 -0
  70. molbuilder/visualization/molecule_viz.py +368 -0
  71. molbuilder/visualization/quantum_viz.py +434 -0
  72. molbuilder/visualization/theme.py +12 -0
  73. molbuilder-1.0.0.dist-info/METADATA +360 -0
  74. molbuilder-1.0.0.dist-info/RECORD +78 -0
  75. molbuilder-1.0.0.dist-info/WHEEL +5 -0
  76. molbuilder-1.0.0.dist-info/entry_points.txt +2 -0
  77. molbuilder-1.0.0.dist-info/licenses/LICENSE +21 -0
  78. molbuilder-1.0.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,102 @@
1
+ """Reaction categories, templates, and data structures."""
2
+
3
+ from __future__ import annotations
4
+ from dataclasses import dataclass, field
5
+ from enum import Enum, auto
6
+
7
+
8
+ class ReactionCategory(Enum):
9
+ SUBSTITUTION = auto()
10
+ ELIMINATION = auto()
11
+ ADDITION = auto()
12
+ OXIDATION = auto()
13
+ REDUCTION = auto()
14
+ COUPLING = auto()
15
+ CARBONYL = auto()
16
+ PROTECTION = auto()
17
+ DEPROTECTION = auto()
18
+ REARRANGEMENT = auto()
19
+ RADICAL = auto()
20
+ PERICYCLIC = auto()
21
+ POLYMERIZATION = auto()
22
+ MISC = auto()
23
+
24
+
25
+ @dataclass
26
+ class ReactionTemplate:
27
+ """A curated reaction template for synthesis planning.
28
+
29
+ Each template captures the essential information needed to evaluate
30
+ whether a reaction is applicable to a given substrate and to estimate
31
+ its likely outcome. Templates are consumed by the retrosynthetic
32
+ planner and by the forward-synthesis scoring engine.
33
+
34
+ Attributes
35
+ ----------
36
+ name : str
37
+ Short human-readable name for the transformation.
38
+ named_reaction : str | None
39
+ Conventional named-reaction label (e.g. "Suzuki coupling").
40
+ category : ReactionCategory
41
+ Broad classification of the reaction type.
42
+ reagents : list[str]
43
+ Required reagents (stoichiometric).
44
+ solvents : list[str]
45
+ Suitable solvents.
46
+ catalysts : list[str]
47
+ Catalysts or co-catalysts (may be empty).
48
+ temperature_range : tuple[float, float]
49
+ Typical temperature window in degrees Celsius.
50
+ typical_yield : tuple[float, float]
51
+ Expected isolated-yield range in percent.
52
+ functional_group_required : list[str]
53
+ Functional groups that must be present on the substrate.
54
+ functional_group_produced : list[str]
55
+ Functional groups introduced or revealed by the reaction.
56
+ functional_group_incompatible : list[str]
57
+ Functional groups that would be destroyed or interfere.
58
+ mechanism : str
59
+ One- or two-sentence description of the mechanism.
60
+ reverse_transform : str
61
+ Description of the retrosynthetic disconnection.
62
+ scale_notes : str
63
+ Practical notes on scaling the reaction.
64
+ safety_notes : str
65
+ Hazard or handling warnings.
66
+ """
67
+
68
+ name: str
69
+ named_reaction: str | None
70
+ category: ReactionCategory
71
+ reagents: list[str]
72
+ solvents: list[str]
73
+ catalysts: list[str] = field(default_factory=list)
74
+ temperature_range: tuple[float, float] = (20.0, 25.0)
75
+ typical_yield: tuple[float, float] = (60.0, 90.0)
76
+ functional_group_required: list[str] = field(default_factory=list)
77
+ functional_group_produced: list[str] = field(default_factory=list)
78
+ functional_group_incompatible: list[str] = field(default_factory=list)
79
+ mechanism: str = ""
80
+ reverse_transform: str = ""
81
+ scale_notes: str = ""
82
+ safety_notes: str = ""
83
+
84
+ # ------------------------------------------------------------------
85
+ # helpers
86
+ # ------------------------------------------------------------------
87
+
88
+ def requires(self, fg_name: str) -> bool:
89
+ """Return True if *fg_name* is among the required functional groups."""
90
+ return fg_name.lower() in [f.lower() for f in self.functional_group_required]
91
+
92
+ def produces(self, fg_name: str) -> bool:
93
+ """Return True if *fg_name* is among the produced functional groups."""
94
+ return fg_name.lower() in [f.lower() for f in self.functional_group_produced]
95
+
96
+ def is_compatible(self, fg_names: list[str]) -> bool:
97
+ """Return True if none of *fg_names* appear in the incompatible list."""
98
+ incompat = {f.lower() for f in self.functional_group_incompatible}
99
+ return not any(fg.lower() in incompat for fg in fg_names)
100
+
101
+ def __repr__(self) -> str:
102
+ return f"ReactionTemplate({self.name}, {self.category.name})"