Commit 3980055
feat(phase1): implement all Phase 1 polymer architectures (#90)
* feat(core): implement Phase 1 polymer architectures (US-1.1.1 → US-1.4.2)
## Nouveaux builders
### LinearBuilder (linear.rs)
- US-1.1.1: `random_copolymer(&[f64])` — copolymère statistique avec seed
- US-1.1.2: `alternating_copolymer()` — séquence A-B-A-B cyclique
- US-1.1.3: `block_copolymer(&[usize])` — diblock/triblock/multiblock
- US-1.1.4: `gradient_copolymer(&GradientProfile)` — gradient linéaire ou sigmoïde
- US-1.2.5: `cyclic_homopolymer()` — ring closure premier↔dernier atome
- US-1.3.3: `with_end_groups()` — préfixe/suffixe BigSMILES inclus dans SMILES + Mn
### BranchedBuilder (branched.rs)
- US-1.2.1: `comb_polymer(branch_every)` — peigne régulier backbone+branch
- US-1.2.2: `graft_copolymer(graft_fraction, seed)` — greffage aléatoire reproductible
- US-1.2.3: `star_polymer(arms)` — étoile 3–12 bras
- US-1.2.4: `dendrimer(generation, branching_factor)` — dendrimère G1–G6
### EnsembleBuilder (ensemble.rs)
- `random_copolymer_ensemble`, `alternating_copolymer_ensemble`,
`block_copolymer_ensemble`, `gradient_copolymer_ensemble`
## PolymerChain enrichi (US-1.3.1, US-1.3.2)
- Nouveau champ `composition: Vec<MonomerUnit>` (fraction molaire par unité)
- Nouveau champ `architecture: Architecture` (Linear/Star/Comb/Dendrimer/Cyclic/Gradient/Graft)
- API builder fluent: `.with_composition()` et `.with_architecture()`
## CLI (US-1.4.1, US-1.4.2)
- `polysim analyze` : `--arch random|alternating|block|gradient`
- `polysim generate` : idem + `--gradient-profile linear|sigmoid`,
`--gradient-f-start`, `--gradient-f-end`
## Tests: 35 nouveaux tests (tous verts)
- `tests/copolymer.rs` : 17 tests random/alternating/block + ensembles
- `tests/branched.rs` : 9 tests comb/graft/star/dendrimer
- `tests/gradient_cyclic.rs` : 9 tests gradient/cyclic/end-groups
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* docs: add roadmap
* test(core): add cyclic regression test for two-letter atoms (Cl)
Vérifie que make_cyclic_smiles ne corrompt pas les atomes bi-lettres
comme Cl lors de l'insertion du ring closure.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
---------
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent 2852e6e commit 3980055
File tree
17 files changed
+2971
-61
lines changed- crates
- polysim-cli/src
- commands
- polysim-core
- src
- builder
- polymer
- tests
17 files changed
+2971
-61
lines changedLarge diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
| 14 | + | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
18 | 22 | | |
19 | 23 | | |
20 | | - | |
21 | | - | |
22 | | - | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
23 | 46 | | |
24 | 47 | | |
25 | 48 | | |
26 | 49 | | |
27 | 50 | | |
28 | 51 | | |
| 52 | + | |
29 | 53 | | |
30 | 54 | | |
31 | 55 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
| 12 | + | |
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
| |||
36 | 37 | | |
37 | 38 | | |
38 | 39 | | |
39 | | - | |
40 | | - | |
| 40 | + | |
| 41 | + | |
41 | 42 | | |
42 | 43 | | |
43 | | - | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
44 | 52 | | |
45 | 53 | | |
46 | 54 | | |
| |||
51 | 59 | | |
52 | 60 | | |
53 | 61 | | |
| 62 | + | |
54 | 63 | | |
55 | 64 | | |
56 | | - | |
57 | | - | |
58 | | - | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
59 | 68 | | |
60 | 69 | | |
61 | 70 | | |
| |||
66 | 75 | | |
67 | 76 | | |
68 | 77 | | |
| 78 | + | |
69 | 79 | | |
70 | 80 | | |
71 | 81 | | |
72 | 82 | | |
73 | 83 | | |
74 | | - | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
75 | 101 | | |
76 | 102 | | |
77 | 103 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| 29 | + | |
29 | 30 | | |
30 | 31 | | |
31 | 32 | | |
| |||
131 | 132 | | |
132 | 133 | | |
133 | 134 | | |
134 | | - | |
| 135 | + | |
135 | 136 | | |
136 | 137 | | |
137 | 138 | | |
138 | 139 | | |
139 | 140 | | |
140 | 141 | | |
| 142 | + | |
141 | 143 | | |
142 | 144 | | |
143 | 145 | | |
144 | 146 | | |
145 | 147 | | |
146 | | - | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
147 | 156 | | |
148 | 157 | | |
149 | 158 | | |
| |||
161 | 170 | | |
162 | 171 | | |
163 | 172 | | |
| 173 | + | |
164 | 174 | | |
165 | 175 | | |
166 | 176 | | |
167 | 177 | | |
168 | 178 | | |
| 179 | + | |
169 | 180 | | |
170 | 181 | | |
171 | 182 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | 31 | | |
35 | 32 | | |
36 | 33 | | |
37 | 34 | | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| |||
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
67 | 70 | | |
68 | 71 | | |
69 | 72 | | |
| |||
108 | 111 | | |
109 | 112 | | |
110 | 113 | | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
111 | 202 | | |
112 | 203 | | |
113 | 204 | | |
| |||
131 | 222 | | |
132 | 223 | | |
133 | 224 | | |
| 225 | + | |
134 | 226 | | |
135 | | - | |
| 227 | + | |
136 | 228 | | |
137 | 229 | | |
138 | 230 | | |
| |||
143 | 235 | | |
144 | 236 | | |
145 | 237 | | |
| 238 | + | |
146 | 239 | | |
147 | 240 | | |
148 | | - | |
| 241 | + | |
149 | 242 | | |
150 | 243 | | |
151 | 244 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
| |||
0 commit comments