Skip to content

Commit df01573

Browse files
committed
Revert "refactor(describer): structure-driven prose (port from earlier branch)"
removing the describer functionality from the main branch, as it is not yet ready for production use. This reverts commit fc7ada9.
1 parent 63cb53d commit df01573

6 files changed

Lines changed: 221 additions & 535 deletions

File tree

README.md

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -87,26 +87,18 @@ for step in analysis.decisions:
8787

8888
### Natural-language description (`describe`)
8989

90-
`bluenamer.describe(smiles)` emits structure-driven, reconstructable
91-
prose about the molecule: the parent skeleton, heteroatoms, unsaturation,
92-
stereochemistry, substituents, and connectivity for atom-by-atom
93-
rebuilding. Useful for explainability views and for generating
94-
(SMILES, name, description) training tuples:
90+
`bluenamer.describe(smiles)` walks the same trace and renders a
91+
deterministic, multi-paragraph explanation of how the name is built.
92+
Useful for explainability views and for generating (SMILES, name,
93+
description) training tuples:
9594

9695
```python
9796
from bluenamer import describe
9897

99-
d = describe("CCO")
100-
print(d)
101-
# The molecule is built around a 2-atom carbon chain. Within that parent
102-
# framework, all parent-chain bonds are single. Attached to the parent is
103-
# a hydroxy group at position 1. For reconstruction, number the parent
104-
# as follows: 1-2 single.
105-
106-
d.facts[0].parent_summary # 'a 2-atom carbon chain'
107-
d.facts[0].substituents # ('a hydroxy group at position 1',)
108-
d.facts[0].connectivity # ('1-2 single',)
109-
d.name # 'ethanol' (handy, from the namer)
98+
d = describe("CC(=O)Nc1ccccc1")
99+
print(d) # multi-paragraph prose
100+
d.rules_hit # ('P-44', 'P-45', 'P-41', 'P-61', 'P-67')
101+
d.components[0] # DescribedComponent(phase='parse', text='RDKit parsed ...')
110102
```
111103

112104
Same input → same output. No LLM in the loop.

src/bluenamer/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from collections.abc import Iterable
44

5-
from .describer import Description, DescriptionFacts, describe
5+
from .describer import DescribedComponent, Description, describe
66
from .engine import DEFAULT_NAMING_ENGINE, NamingEngine, NamingRequest, NamingResult
77
from .functional_groups import register_group_detector
88
from .molecule import (
@@ -69,8 +69,8 @@ def name_many(
6969
"AtomBinding",
7070
"BondBinding",
7171
"DecisionTrace",
72+
"DescribedComponent",
7273
"Description",
73-
"DescriptionFacts",
7474
"FunctionalGroupMetadata",
7575
"NameAnalysis",
7676
"NamingEngine",

src/bluenamer/cli.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ def _cmd_describe(args: argparse.Namespace) -> int:
9292
sys.stdout.write("\n")
9393
else:
9494
sys.stdout.write(str(description) + "\n")
95-
return 0 if description.text else 1
95+
return 0 if description.name else 1
9696

9797

9898
def _build_parser() -> argparse.ArgumentParser:

0 commit comments

Comments
 (0)