scigantic-bindingdb 0.2.4__tar.gz → 0.2.5__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 (30) hide show
  1. {scigantic_bindingdb-0.2.4/src/scigantic_bindingdb.egg-info → scigantic_bindingdb-0.2.5}/PKG-INFO +11 -4
  2. {scigantic_bindingdb-0.2.4 → scigantic_bindingdb-0.2.5}/README.md +7 -1
  3. {scigantic_bindingdb-0.2.4 → scigantic_bindingdb-0.2.5}/pyproject.toml +11 -4
  4. {scigantic_bindingdb-0.2.4 → scigantic_bindingdb-0.2.5}/src/scigantic_bindingdb/connection.py +5 -2
  5. {scigantic_bindingdb-0.2.4 → scigantic_bindingdb-0.2.5/src/scigantic_bindingdb.egg-info}/PKG-INFO +11 -4
  6. scigantic_bindingdb-0.2.5/src/scigantic_bindingdb.egg-info/requires.txt +8 -0
  7. {scigantic_bindingdb-0.2.4 → scigantic_bindingdb-0.2.5}/tests/test_connection.py +13 -0
  8. scigantic_bindingdb-0.2.4/src/scigantic_bindingdb.egg-info/requires.txt +0 -7
  9. {scigantic_bindingdb-0.2.4 → scigantic_bindingdb-0.2.5}/LICENSE +0 -0
  10. {scigantic_bindingdb-0.2.4 → scigantic_bindingdb-0.2.5}/setup.cfg +0 -0
  11. {scigantic_bindingdb-0.2.4 → scigantic_bindingdb-0.2.5}/src/scigantic_bindingdb/__init__.py +0 -0
  12. {scigantic_bindingdb-0.2.4 → scigantic_bindingdb-0.2.5}/src/scigantic_bindingdb/__main__.py +0 -0
  13. {scigantic_bindingdb-0.2.4 → scigantic_bindingdb-0.2.5}/src/scigantic_bindingdb/_constants.py +0 -0
  14. {scigantic_bindingdb-0.2.4 → scigantic_bindingdb-0.2.5}/src/scigantic_bindingdb/cache.py +0 -0
  15. {scigantic_bindingdb-0.2.4 → scigantic_bindingdb-0.2.5}/src/scigantic_bindingdb/chembl_bridge.py +0 -0
  16. {scigantic_bindingdb-0.2.4 → scigantic_bindingdb-0.2.5}/src/scigantic_bindingdb/cli.py +0 -0
  17. {scigantic_bindingdb-0.2.4 → scigantic_bindingdb-0.2.5}/src/scigantic_bindingdb/dti_pairs.py +0 -0
  18. {scigantic_bindingdb-0.2.4 → scigantic_bindingdb-0.2.5}/src/scigantic_bindingdb/measurements.py +0 -0
  19. {scigantic_bindingdb-0.2.4 → scigantic_bindingdb-0.2.5}/src/scigantic_bindingdb/py.typed +0 -0
  20. {scigantic_bindingdb-0.2.4 → scigantic_bindingdb-0.2.5}/src/scigantic_bindingdb/releases.py +0 -0
  21. {scigantic_bindingdb-0.2.4 → scigantic_bindingdb-0.2.5}/src/scigantic_bindingdb.egg-info/SOURCES.txt +0 -0
  22. {scigantic_bindingdb-0.2.4 → scigantic_bindingdb-0.2.5}/src/scigantic_bindingdb.egg-info/dependency_links.txt +0 -0
  23. {scigantic_bindingdb-0.2.4 → scigantic_bindingdb-0.2.5}/src/scigantic_bindingdb.egg-info/entry_points.txt +0 -0
  24. {scigantic_bindingdb-0.2.4 → scigantic_bindingdb-0.2.5}/src/scigantic_bindingdb.egg-info/top_level.txt +0 -0
  25. {scigantic_bindingdb-0.2.4 → scigantic_bindingdb-0.2.5}/tests/test_cache.py +0 -0
  26. {scigantic_bindingdb-0.2.4 → scigantic_bindingdb-0.2.5}/tests/test_chembl_bridge.py +0 -0
  27. {scigantic_bindingdb-0.2.4 → scigantic_bindingdb-0.2.5}/tests/test_cli.py +0 -0
  28. {scigantic_bindingdb-0.2.4 → scigantic_bindingdb-0.2.5}/tests/test_dti_pairs.py +0 -0
  29. {scigantic_bindingdb-0.2.4 → scigantic_bindingdb-0.2.5}/tests/test_measurements.py +0 -0
  30. {scigantic_bindingdb-0.2.4 → scigantic_bindingdb-0.2.5}/tests/test_releases.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: scigantic-bindingdb
3
- Version: 0.2.4
3
+ Version: 0.2.5
4
4
  Summary: Query BindingDB directly from a public S3 mirror with DuckDB, including a ChEMBL cross-reference bridge table and a ready drug-target-interaction training table.
5
5
  Author: Scigantic
6
6
  License: MIT-0
@@ -21,10 +21,11 @@ Classifier: Topic :: Scientific/Engineering :: Chemistry
21
21
  Requires-Python: >=3.10
22
22
  Description-Content-Type: text/markdown
23
23
  License-File: LICENSE
24
- Requires-Dist: duckdb>=0.10
25
- Requires-Dist: pandas>=1.5
24
+ Requires-Dist: duckdb<2,>=0.10
25
+ Requires-Dist: pandas<4,>=1.5
26
26
  Provides-Extra: dev
27
27
  Requires-Dist: pytest>=7; extra == "dev"
28
+ Requires-Dist: pytest-cov>=5; extra == "dev"
28
29
  Requires-Dist: mypy>=1.10; extra == "dev"
29
30
  Requires-Dist: pandas-stubs; extra == "dev"
30
31
  Dynamic: license-file
@@ -163,4 +164,10 @@ $ scigantic-bindingdb query "SELECT count(*) FROM measurements" --release 202608
163
164
 
164
165
  ## License
165
166
 
166
- MIT-0. See [LICENSE](LICENSE).
167
+ MIT-0. See [LICENSE](LICENSE). This covers the code in this package only.
168
+
169
+ ## Data license
170
+
171
+ BindingDB's underlying data is not under one license: it's a row-by-row mix, determined by each measurement's `curation_source` column. BindingDB [licenses](https://www.bindingdb.org/rwd/bind/info.jsp) its own staff-curated rows under [CC BY 3.0](https://creativecommons.org/licenses/by/3.0/), but rows imported from ChEMBL (`curation_source = 'ChEMBL'`, 51.3% of measurements in the 202608 release) carry ChEMBL's own [CC BY-SA 3.0](https://creativecommons.org/licenses/by-sa/3.0/) terms instead, share-alike included. Check `curation_source` before redistributing a subset of `measurements` or `dti_pairs()` to know which terms apply to those specific rows.
172
+
173
+ `chembl_bridge()` results specifically warrant care regardless of a matched measurement's own `curation_source`: every row includes `chembl_id`/`chembl_molregno` matched from ChEMBL's own `molecule_dictionary`, and with the default `with_names=True`, ChEMBL's own `pref_name`. Those columns carry ChEMBL's CC BY-SA 3.0 terms, independent of whichever license applies to the rest of that row.
@@ -132,4 +132,10 @@ $ scigantic-bindingdb query "SELECT count(*) FROM measurements" --release 202608
132
132
 
133
133
  ## License
134
134
 
135
- MIT-0. See [LICENSE](LICENSE).
135
+ MIT-0. See [LICENSE](LICENSE). This covers the code in this package only.
136
+
137
+ ## Data license
138
+
139
+ BindingDB's underlying data is not under one license: it's a row-by-row mix, determined by each measurement's `curation_source` column. BindingDB [licenses](https://www.bindingdb.org/rwd/bind/info.jsp) its own staff-curated rows under [CC BY 3.0](https://creativecommons.org/licenses/by/3.0/), but rows imported from ChEMBL (`curation_source = 'ChEMBL'`, 51.3% of measurements in the 202608 release) carry ChEMBL's own [CC BY-SA 3.0](https://creativecommons.org/licenses/by-sa/3.0/) terms instead, share-alike included. Check `curation_source` before redistributing a subset of `measurements` or `dti_pairs()` to know which terms apply to those specific rows.
140
+
141
+ `chembl_bridge()` results specifically warrant care regardless of a matched measurement's own `curation_source`: every row includes `chembl_id`/`chembl_molregno` matched from ChEMBL's own `molecule_dictionary`, and with the default `with_names=True`, ChEMBL's own `pref_name`. Those columns carry ChEMBL's CC BY-SA 3.0 terms, independent of whichever license applies to the rest of that row.
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "scigantic-bindingdb"
7
- version = "0.2.4"
7
+ version = "0.2.5"
8
8
  description = "Query BindingDB directly from a public S3 mirror with DuckDB, including a ChEMBL cross-reference bridge table and a ready drug-target-interaction training table."
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.10"
@@ -25,12 +25,12 @@ classifiers = [
25
25
  ]
26
26
 
27
27
  dependencies = [
28
- "duckdb>=0.10",
29
- "pandas>=1.5",
28
+ "duckdb>=0.10,<2",
29
+ "pandas>=1.5,<4",
30
30
  ]
31
31
 
32
32
  [project.optional-dependencies]
33
- dev = ["pytest>=7", "mypy>=1.10", "pandas-stubs"]
33
+ dev = ["pytest>=7", "pytest-cov>=5", "mypy>=1.10", "pandas-stubs"]
34
34
 
35
35
  [project.urls]
36
36
  Homepage = "https://scigantic.com"
@@ -49,5 +49,12 @@ scigantic_bindingdb = ["py.typed"]
49
49
  [tool.pytest.ini_options]
50
50
  testpaths = ["tests"]
51
51
 
52
+ [tool.coverage.run]
53
+ source = ["scigantic_bindingdb"]
54
+ # Not wired into CI as a gate: this suite runs real queries against the live
55
+ # S3 mirror, so a coverage threshold would be one more thing that can fail
56
+ # for reasons unrelated to a change. `pytest --cov` is available locally for
57
+ # anyone who wants the number.
58
+
52
59
  [tool.mypy]
53
60
  strict = true
@@ -123,8 +123,11 @@ def query(sql: str, release: str | None = None) -> "pd.DataFrame":
123
123
  For several queries against the same release, call connect() once and
124
124
  reuse it instead, to avoid opening and closing a cursor per query.
125
125
  """
126
- con = connect(release)
126
+ resolved_release = release or latest()
127
+ con = connect(resolved_release)
127
128
  try:
128
- return con.execute(sql).df()
129
+ df = con.execute(sql).df()
130
+ df.attrs["bindingdb_release"] = resolved_release
131
+ return df
129
132
  finally:
130
133
  con.close()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: scigantic-bindingdb
3
- Version: 0.2.4
3
+ Version: 0.2.5
4
4
  Summary: Query BindingDB directly from a public S3 mirror with DuckDB, including a ChEMBL cross-reference bridge table and a ready drug-target-interaction training table.
5
5
  Author: Scigantic
6
6
  License: MIT-0
@@ -21,10 +21,11 @@ Classifier: Topic :: Scientific/Engineering :: Chemistry
21
21
  Requires-Python: >=3.10
22
22
  Description-Content-Type: text/markdown
23
23
  License-File: LICENSE
24
- Requires-Dist: duckdb>=0.10
25
- Requires-Dist: pandas>=1.5
24
+ Requires-Dist: duckdb<2,>=0.10
25
+ Requires-Dist: pandas<4,>=1.5
26
26
  Provides-Extra: dev
27
27
  Requires-Dist: pytest>=7; extra == "dev"
28
+ Requires-Dist: pytest-cov>=5; extra == "dev"
28
29
  Requires-Dist: mypy>=1.10; extra == "dev"
29
30
  Requires-Dist: pandas-stubs; extra == "dev"
30
31
  Dynamic: license-file
@@ -163,4 +164,10 @@ $ scigantic-bindingdb query "SELECT count(*) FROM measurements" --release 202608
163
164
 
164
165
  ## License
165
166
 
166
- MIT-0. See [LICENSE](LICENSE).
167
+ MIT-0. See [LICENSE](LICENSE). This covers the code in this package only.
168
+
169
+ ## Data license
170
+
171
+ BindingDB's underlying data is not under one license: it's a row-by-row mix, determined by each measurement's `curation_source` column. BindingDB [licenses](https://www.bindingdb.org/rwd/bind/info.jsp) its own staff-curated rows under [CC BY 3.0](https://creativecommons.org/licenses/by/3.0/), but rows imported from ChEMBL (`curation_source = 'ChEMBL'`, 51.3% of measurements in the 202608 release) carry ChEMBL's own [CC BY-SA 3.0](https://creativecommons.org/licenses/by-sa/3.0/) terms instead, share-alike included. Check `curation_source` before redistributing a subset of `measurements` or `dti_pairs()` to know which terms apply to those specific rows.
172
+
173
+ `chembl_bridge()` results specifically warrant care regardless of a matched measurement's own `curation_source`: every row includes `chembl_id`/`chembl_molregno` matched from ChEMBL's own `molecule_dictionary`, and with the default `with_names=True`, ChEMBL's own `pref_name`. Those columns carry ChEMBL's CC BY-SA 3.0 terms, independent of whichever license applies to the rest of that row.
@@ -0,0 +1,8 @@
1
+ duckdb<2,>=0.10
2
+ pandas<4,>=1.5
3
+
4
+ [dev]
5
+ pytest>=7
6
+ pytest-cov>=5
7
+ mypy>=1.10
8
+ pandas-stubs
@@ -20,6 +20,19 @@ def test_query_returns_dataframe_with_expected_columns():
20
20
  assert len(df) == 5
21
21
 
22
22
 
23
+ def test_query_records_bindingdb_release_in_attrs():
24
+ # Matches scigantic_chembl's query(), which stamps df.attrs["chembl_release"]
25
+ # the same way: the release actually used should travel with the result,
26
+ # not just be implicit in whatever the caller happened to pass.
27
+ df = bindingdb.query("SELECT 1", release="202608")
28
+ assert df.attrs["bindingdb_release"] == "202608"
29
+
30
+
31
+ def test_query_omitted_release_records_resolved_release_in_attrs():
32
+ df = bindingdb.query("SELECT 1")
33
+ assert df.attrs["bindingdb_release"] == bindingdb.latest()
34
+
35
+
23
36
  def test_connect_registers_all_five_core_tables():
24
37
  con = bindingdb.connect()
25
38
  try:
@@ -1,7 +0,0 @@
1
- duckdb>=0.10
2
- pandas>=1.5
3
-
4
- [dev]
5
- pytest>=7
6
- mypy>=1.10
7
- pandas-stubs