rxnmapper 0.4.1__tar.gz → 0.4.3__tar.gz

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 (31) hide show
  1. {rxnmapper-0.4.1/rxnmapper.egg-info → rxnmapper-0.4.3}/PKG-INFO +23 -30
  2. {rxnmapper-0.4.1 → rxnmapper-0.4.3}/README.md +18 -26
  3. {rxnmapper-0.4.1 → rxnmapper-0.4.3}/rxnmapper/__init__.py +1 -1
  4. {rxnmapper-0.4.1 → rxnmapper-0.4.3}/rxnmapper/core.py +2 -2
  5. {rxnmapper-0.4.1 → rxnmapper-0.4.3}/rxnmapper/tokenization_smiles.py +3 -3
  6. {rxnmapper-0.4.1 → rxnmapper-0.4.3/rxnmapper.egg-info}/PKG-INFO +23 -30
  7. {rxnmapper-0.4.1 → rxnmapper-0.4.3}/rxnmapper.egg-info/requires.txt +2 -2
  8. {rxnmapper-0.4.1 → rxnmapper-0.4.3}/setup.cfg +2 -2
  9. {rxnmapper-0.4.1 → rxnmapper-0.4.3}/LICENSE +0 -0
  10. {rxnmapper-0.4.1 → rxnmapper-0.4.3}/MANIFEST.in +0 -0
  11. {rxnmapper-0.4.1 → rxnmapper-0.4.3}/pyproject.toml +0 -0
  12. {rxnmapper-0.4.1 → rxnmapper-0.4.3}/rxnmapper/attention.py +0 -0
  13. {rxnmapper-0.4.1 → rxnmapper-0.4.3}/rxnmapper/batched_mapper.py +0 -0
  14. {rxnmapper-0.4.1 → rxnmapper-0.4.3}/rxnmapper/models/transformers/albert_heads_8_uspto_all_1310k/config.json +0 -0
  15. {rxnmapper-0.4.1 → rxnmapper-0.4.3}/rxnmapper/models/transformers/albert_heads_8_uspto_all_1310k/pytorch_model.bin +0 -0
  16. {rxnmapper-0.4.1 → rxnmapper-0.4.3}/rxnmapper/models/transformers/albert_heads_8_uspto_all_1310k/special_tokens_map.json +0 -0
  17. {rxnmapper-0.4.1 → rxnmapper-0.4.3}/rxnmapper/models/transformers/albert_heads_8_uspto_all_1310k/tokenizer_config.json +0 -0
  18. {rxnmapper-0.4.1 → rxnmapper-0.4.3}/rxnmapper/models/transformers/albert_heads_8_uspto_all_1310k/training_args.bin +0 -0
  19. {rxnmapper-0.4.1 → rxnmapper-0.4.3}/rxnmapper/models/transformers/albert_heads_8_uspto_all_1310k/vocab.txt +0 -0
  20. {rxnmapper-0.4.1 → rxnmapper-0.4.3}/rxnmapper/py.typed +0 -0
  21. {rxnmapper-0.4.1 → rxnmapper-0.4.3}/rxnmapper/smiles_utils.py +0 -0
  22. {rxnmapper-0.4.1 → rxnmapper-0.4.3}/rxnmapper.egg-info/SOURCES.txt +0 -0
  23. {rxnmapper-0.4.1 → rxnmapper-0.4.3}/rxnmapper.egg-info/dependency_links.txt +0 -0
  24. {rxnmapper-0.4.1 → rxnmapper-0.4.3}/rxnmapper.egg-info/not-zip-safe +0 -0
  25. {rxnmapper-0.4.1 → rxnmapper-0.4.3}/rxnmapper.egg-info/top_level.txt +0 -0
  26. {rxnmapper-0.4.1 → rxnmapper-0.4.3}/setup.py +0 -0
  27. {rxnmapper-0.4.1 → rxnmapper-0.4.3}/tests/__init__.py +0 -0
  28. {rxnmapper-0.4.1 → rxnmapper-0.4.3}/tests/test_batched_mapper.py +0 -0
  29. {rxnmapper-0.4.1 → rxnmapper-0.4.3}/tests/test_mapper.py +0 -0
  30. {rxnmapper-0.4.1 → rxnmapper-0.4.3}/tests/test_smiles_utils.py +0 -0
  31. {rxnmapper-0.4.1 → rxnmapper-0.4.3}/tests/utils.py +0 -0
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.2
1
+ Metadata-Version: 2.4
2
2
  Name: rxnmapper
3
- Version: 0.4.1
3
+ Version: 0.4.3
4
4
  Summary: Reaction atom-mapping from transformers
5
5
  Home-page: https://github.com/rxn4chemistry/rxnmapper
6
6
  Author: IBM RXN team
@@ -24,8 +24,8 @@ License-File: LICENSE
24
24
  Requires-Dist: pandas>=1.0.3
25
25
  Requires-Dist: rxn-chem-utils>=1.0.3
26
26
  Requires-Dist: scipy>=1.4.1
27
- Requires-Dist: torch<2.5,>=1.5.0
28
- Requires-Dist: transformers>=4.0.0
27
+ Requires-Dist: torch>=1.5.0
28
+ Requires-Dist: transformers<5.0.0,>=4.0.0
29
29
  Provides-Extra: dev
30
30
  Requires-Dist: black>=22.1.0; extra == "dev"
31
31
  Requires-Dist: bump2version>=1.0.1; extra == "dev"
@@ -40,6 +40,7 @@ Requires-Dist: types-setuptools>=62.6.0; extra == "dev"
40
40
  Provides-Extra: rdkit
41
41
  Requires-Dist: rdkit-pypi>=2021.3.2; python_version < "3.7" and extra == "rdkit"
42
42
  Requires-Dist: rdkit>=2022.3.4; python_version >= "3.7" and extra == "rdkit"
43
+ Dynamic: license-file
43
44
 
44
45
  # Extraction of organic chemistry grammar from unsupervised learning of chemical reactions
45
46
  Enable robust atom mapping on valid reaction SMILES. The atom-mapping information was learned by an ALBERT model trained in an unsupervised fashion on a large dataset of chemical reactions.
@@ -50,37 +51,27 @@ Enable robust atom mapping on valid reaction SMILES. The atom-mapping informatio
50
51
 
51
52
  ## Installation
52
53
 
53
- ### From pip
54
- ```console
55
- conda create -n rxnmapper python=3.6 -y
56
- conda activate rxnmapper
57
- pip install rxnmapper
54
+ ### Create virtual environment (optional)
55
+
56
+ ```bash
57
+ python3 -m venv .venv
58
+ source .venv/bin/activate
58
59
  ```
59
60
 
60
- ### From github
61
- You can install the package and setup the environment directly from github using:
61
+ ### Install from pip
62
62
 
63
- ```console
64
- git clone https://github.com/rxn4chemistry/rxnmapper.git
65
- cd rxnmapper
66
- conda create -n rxnmapper python=3.6 -y
67
- conda activate rxnmapper
68
- pip install -e .
63
+ ```bash
64
+ pip install "rxnmapper[rdkit]"
69
65
  ```
70
66
 
71
- ### RDkit
67
+ You can leave out `[rdkit]` if RDKit is already available in your Python environment.
72
68
 
73
- In both installation settings above, the `RDKit` dependency is not installed automatically, unless you include the extra when installing: `pip install "rxmapper[rdkit]"`.
74
- It can also be installed via Conda or Pypi:
69
+ ### From source
75
70
 
76
71
  ```bash
77
- # Install RDKit from Conda
78
- conda install -c conda-forge rdkit
79
-
80
- # Install RDKit from Pypi
81
- pip install rdkit
82
- # for Python<3.7
83
- # pip install rdkit-pypi
72
+ git clone https://github.com/rxn4chemistry/rxnmapper.git
73
+ cd rxnmapper
74
+ pip install -e ".[rdkit]"
84
75
  ```
85
76
 
86
77
  ## Usage
@@ -117,10 +108,12 @@ results = list(rxn_mapper.map_reactions_with_info(rxns)) # results as dictionar
117
108
 
118
109
  ### Testing
119
110
 
120
- You can run the examples above with the test suite as well:
111
+ You can run the test suite with:
121
112
 
122
- 1. In your Conda environment: `pip install -e .[dev]`
123
- 2. `pytest tests` from the root
113
+ ```bash
114
+ pip install -e .[dev,rdkit]
115
+ pytest tests
116
+ ```
124
117
 
125
118
  ## Examples
126
119
 
@@ -7,37 +7,27 @@ Enable robust atom mapping on valid reaction SMILES. The atom-mapping informatio
7
7
 
8
8
  ## Installation
9
9
 
10
- ### From pip
11
- ```console
12
- conda create -n rxnmapper python=3.6 -y
13
- conda activate rxnmapper
14
- pip install rxnmapper
10
+ ### Create virtual environment (optional)
11
+
12
+ ```bash
13
+ python3 -m venv .venv
14
+ source .venv/bin/activate
15
15
  ```
16
16
 
17
- ### From github
18
- You can install the package and setup the environment directly from github using:
17
+ ### Install from pip
19
18
 
20
- ```console
21
- git clone https://github.com/rxn4chemistry/rxnmapper.git
22
- cd rxnmapper
23
- conda create -n rxnmapper python=3.6 -y
24
- conda activate rxnmapper
25
- pip install -e .
19
+ ```bash
20
+ pip install "rxnmapper[rdkit]"
26
21
  ```
27
22
 
28
- ### RDkit
23
+ You can leave out `[rdkit]` if RDKit is already available in your Python environment.
29
24
 
30
- In both installation settings above, the `RDKit` dependency is not installed automatically, unless you include the extra when installing: `pip install "rxmapper[rdkit]"`.
31
- It can also be installed via Conda or Pypi:
25
+ ### From source
32
26
 
33
27
  ```bash
34
- # Install RDKit from Conda
35
- conda install -c conda-forge rdkit
36
-
37
- # Install RDKit from Pypi
38
- pip install rdkit
39
- # for Python<3.7
40
- # pip install rdkit-pypi
28
+ git clone https://github.com/rxn4chemistry/rxnmapper.git
29
+ cd rxnmapper
30
+ pip install -e ".[rdkit]"
41
31
  ```
42
32
 
43
33
  ## Usage
@@ -74,10 +64,12 @@ results = list(rxn_mapper.map_reactions_with_info(rxns)) # results as dictionar
74
64
 
75
65
  ### Testing
76
66
 
77
- You can run the examples above with the test suite as well:
67
+ You can run the test suite with:
78
68
 
79
- 1. In your Conda environment: `pip install -e .[dev]`
80
- 2. `pytest tests` from the root
69
+ ```bash
70
+ pip install -e .[dev,rdkit]
71
+ pytest tests
72
+ ```
81
73
 
82
74
  ## Examples
83
75
 
@@ -1,7 +1,7 @@
1
1
  """rxnmapper initialization."""
2
2
 
3
3
  __name__ = "rxnmapper"
4
- __version__ = "0.4.1" # managed by bump2version
4
+ __version__ = "0.4.3" # managed by bump2version
5
5
 
6
6
 
7
7
  from .batched_mapper import BatchedMapper
@@ -286,14 +286,14 @@ class RXNMapper:
286
286
  rxn, output["pxr_mapping_vector"], canonical=canonicalize_rxns
287
287
  )
288
288
  result = {
289
- "confidence": np.prod(output["confidences"]),
289
+ "confidence": float(np.prod(output["confidences"])),
290
290
  }
291
291
  if detailed_output:
292
292
  result["pxr_mapping_vector"] = output["pxr_mapping_vector"]
293
293
  result["pxr_confidences"] = output["confidences"]
294
294
  result["mapping_tuples"] = output["mapping_tuples"]
295
295
  result["pxrrxp_attns"] = output["pxrrxp_attns"]
296
- result["tokensxtokens_attns"] = tokensxtokens_attn
296
+ result["tokensxtokens_attns"] = tokensxtokens_attn # type: ignore[assignment]
297
297
  result["tokens"] = just_tokens
298
298
 
299
299
  yield mapped_reaction, result
@@ -49,7 +49,7 @@ class SmilesTokenizer(BertTokenizer):
49
49
  self.ids_to_tokens = collections.OrderedDict(
50
50
  [(ids, tok) for tok, ids in self.vocab.items()]
51
51
  )
52
- self.basic_tokenizer = BasicSmilesTokenizer()
52
+ self.basic_tokenizer = BasicSmilesTokenizer() # type: ignore[assignment]
53
53
  self.init_kwargs["model_max_length"] = self.model_max_length
54
54
 
55
55
  @property
@@ -60,7 +60,7 @@ class SmilesTokenizer(BertTokenizer):
60
60
  def vocab_list(self):
61
61
  return list(self.vocab.keys())
62
62
 
63
- def _tokenize(self, text):
63
+ def _tokenize(self, text): # type: ignore[override]
64
64
  split_tokens = [token for token in self.basic_tokenizer.tokenize(text)]
65
65
  return split_tokens
66
66
 
@@ -120,7 +120,7 @@ class SmilesTokenizer(BertTokenizer):
120
120
  else:
121
121
  return padding + token_ids
122
122
 
123
- def save_vocabulary(self, vocab_path):
123
+ def save_vocabulary(self, vocab_path): # type: ignore[override]
124
124
  """Save the tokenizer vocabulary to a file."""
125
125
  index = 0
126
126
  vocab_file = vocab_path
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.2
1
+ Metadata-Version: 2.4
2
2
  Name: rxnmapper
3
- Version: 0.4.1
3
+ Version: 0.4.3
4
4
  Summary: Reaction atom-mapping from transformers
5
5
  Home-page: https://github.com/rxn4chemistry/rxnmapper
6
6
  Author: IBM RXN team
@@ -24,8 +24,8 @@ License-File: LICENSE
24
24
  Requires-Dist: pandas>=1.0.3
25
25
  Requires-Dist: rxn-chem-utils>=1.0.3
26
26
  Requires-Dist: scipy>=1.4.1
27
- Requires-Dist: torch<2.5,>=1.5.0
28
- Requires-Dist: transformers>=4.0.0
27
+ Requires-Dist: torch>=1.5.0
28
+ Requires-Dist: transformers<5.0.0,>=4.0.0
29
29
  Provides-Extra: dev
30
30
  Requires-Dist: black>=22.1.0; extra == "dev"
31
31
  Requires-Dist: bump2version>=1.0.1; extra == "dev"
@@ -40,6 +40,7 @@ Requires-Dist: types-setuptools>=62.6.0; extra == "dev"
40
40
  Provides-Extra: rdkit
41
41
  Requires-Dist: rdkit-pypi>=2021.3.2; python_version < "3.7" and extra == "rdkit"
42
42
  Requires-Dist: rdkit>=2022.3.4; python_version >= "3.7" and extra == "rdkit"
43
+ Dynamic: license-file
43
44
 
44
45
  # Extraction of organic chemistry grammar from unsupervised learning of chemical reactions
45
46
  Enable robust atom mapping on valid reaction SMILES. The atom-mapping information was learned by an ALBERT model trained in an unsupervised fashion on a large dataset of chemical reactions.
@@ -50,37 +51,27 @@ Enable robust atom mapping on valid reaction SMILES. The atom-mapping informatio
50
51
 
51
52
  ## Installation
52
53
 
53
- ### From pip
54
- ```console
55
- conda create -n rxnmapper python=3.6 -y
56
- conda activate rxnmapper
57
- pip install rxnmapper
54
+ ### Create virtual environment (optional)
55
+
56
+ ```bash
57
+ python3 -m venv .venv
58
+ source .venv/bin/activate
58
59
  ```
59
60
 
60
- ### From github
61
- You can install the package and setup the environment directly from github using:
61
+ ### Install from pip
62
62
 
63
- ```console
64
- git clone https://github.com/rxn4chemistry/rxnmapper.git
65
- cd rxnmapper
66
- conda create -n rxnmapper python=3.6 -y
67
- conda activate rxnmapper
68
- pip install -e .
63
+ ```bash
64
+ pip install "rxnmapper[rdkit]"
69
65
  ```
70
66
 
71
- ### RDkit
67
+ You can leave out `[rdkit]` if RDKit is already available in your Python environment.
72
68
 
73
- In both installation settings above, the `RDKit` dependency is not installed automatically, unless you include the extra when installing: `pip install "rxmapper[rdkit]"`.
74
- It can also be installed via Conda or Pypi:
69
+ ### From source
75
70
 
76
71
  ```bash
77
- # Install RDKit from Conda
78
- conda install -c conda-forge rdkit
79
-
80
- # Install RDKit from Pypi
81
- pip install rdkit
82
- # for Python<3.7
83
- # pip install rdkit-pypi
72
+ git clone https://github.com/rxn4chemistry/rxnmapper.git
73
+ cd rxnmapper
74
+ pip install -e ".[rdkit]"
84
75
  ```
85
76
 
86
77
  ## Usage
@@ -117,10 +108,12 @@ results = list(rxn_mapper.map_reactions_with_info(rxns)) # results as dictionar
117
108
 
118
109
  ### Testing
119
110
 
120
- You can run the examples above with the test suite as well:
111
+ You can run the test suite with:
121
112
 
122
- 1. In your Conda environment: `pip install -e .[dev]`
123
- 2. `pytest tests` from the root
113
+ ```bash
114
+ pip install -e .[dev,rdkit]
115
+ pytest tests
116
+ ```
124
117
 
125
118
  ## Examples
126
119
 
@@ -1,8 +1,8 @@
1
1
  pandas>=1.0.3
2
2
  rxn-chem-utils>=1.0.3
3
3
  scipy>=1.4.1
4
- torch<2.5,>=1.5.0
5
- transformers>=4.0.0
4
+ torch>=1.5.0
5
+ transformers<5.0.0,>=4.0.0
6
6
 
7
7
  [dev]
8
8
  black>=22.1.0
@@ -31,8 +31,8 @@ install_requires =
31
31
  pandas>=1.0.3
32
32
  rxn-chem-utils>=1.0.3
33
33
  scipy>=1.4.1
34
- torch>=1.5.0,<2.5
35
- transformers>=4.0.0
34
+ torch>=1.5.0
35
+ transformers>=4.0.0,<5.0.0
36
36
 
37
37
  [options.package_data]
38
38
  rxnmapper =
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes