Conversation
stsouko
reviewed
May 8, 2025
|
|
||
| class MarkushContainer: | ||
| __slots__ = ( | ||
| "__meta", |
Member
There was a problem hiding this comment.
no need of memory optimizations. drop slots.
| from collections import defaultdict | ||
| from itertools import product | ||
| from typing import Dict, Iterable, Optional | ||
|
|
| from typing import Dict, Iterable, Optional | ||
|
|
||
| from .molecule import Bond, MoleculeContainer | ||
|
|
|
|
||
| from .molecule import Bond, MoleculeContainer | ||
|
|
||
| var_atoms = ["X", "Y", "Z"] |
Member
There was a problem hiding this comment.
use single quotes unless you can't avoid double
| ) | ||
|
|
||
| def __init__(self, substituents: Optional[list["MoleculeContainer"]] = None): | ||
| super().__init__() |
| self.__initial_mol = None | ||
|
|
||
| @staticmethod | ||
| def connect_w_bond(first: MoleculeContainer, other: MoleculeContainer, variables=var_groups): |
Member
There was a problem hiding this comment.
docstring explaining method usage is required
| return first | ||
|
|
||
| @staticmethod | ||
| def connect_no_bond(first: MoleculeContainer, other: MoleculeContainer, variables=var_atoms): |
| out.append((token_type, {'element': token})) | ||
| elif token_type == 5: | ||
| out.append(_atom_parse(token)) | ||
| if (_match := markush_re.fullmatch(token)) is None: |
Member
There was a problem hiding this comment.
change to is not None. hard to follow.
|
|
||
| @property | ||
| def isotopes_distribution(self): | ||
| return {n: 0. for n in range(1, 100)} |
| return 0 | ||
|
|
||
| @property | ||
| def group_number(self): |
Member
There was a problem hiding this comment.
is it working? and why is needed?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Markush container for chython V2