tablassert 22.3.1__tar.gz → 22.3.2__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 (44) hide show
  1. {tablassert-22.3.1 → tablassert-22.3.2}/PKG-INFO +16 -15
  2. {tablassert-22.3.1 → tablassert-22.3.2}/README.md +15 -14
  3. {tablassert-22.3.1 → tablassert-22.3.2}/pyproject.toml +1 -1
  4. {tablassert-22.3.1 → tablassert-22.3.2}/src/tablassert/cli.py +23 -3
  5. {tablassert-22.3.1 → tablassert-22.3.2}/LICENSE +0 -0
  6. {tablassert-22.3.1 → tablassert-22.3.2}/rust/Cargo.lock +0 -0
  7. {tablassert-22.3.1 → tablassert-22.3.2}/rust/Cargo.toml +0 -0
  8. {tablassert-22.3.1 → tablassert-22.3.2}/rust/examples/count_tables.rs +0 -0
  9. {tablassert-22.3.1 → tablassert-22.3.2}/rust/src/fullmap.rs +0 -0
  10. {tablassert-22.3.1 → tablassert-22.3.2}/rust/src/json.rs +0 -0
  11. {tablassert-22.3.1 → tablassert-22.3.2}/rust/src/lib.rs +0 -0
  12. {tablassert-22.3.1 → tablassert-22.3.2}/rust/src/ndjson.rs +0 -0
  13. {tablassert-22.3.1 → tablassert-22.3.2}/rust/src/nlp.rs +0 -0
  14. {tablassert-22.3.1 → tablassert-22.3.2}/rust/src/uuid.rs +0 -0
  15. {tablassert-22.3.1 → tablassert-22.3.2}/rust/tests/build_golden.rs +0 -0
  16. {tablassert-22.3.1 → tablassert-22.3.2}/rust/tests/common/mod.rs +0 -0
  17. {tablassert-22.3.1 → tablassert-22.3.2}/rust/tests/extract_prebuilt.rs +0 -0
  18. {tablassert-22.3.1 → tablassert-22.3.2}/rust/tests/fixtures/nlp_golden.tsv +0 -0
  19. {tablassert-22.3.1 → tablassert-22.3.2}/rust/tests/nlp_golden.rs +0 -0
  20. {tablassert-22.3.1 → tablassert-22.3.2}/src/tablassert/__init__.py +0 -0
  21. {tablassert-22.3.1 → tablassert-22.3.2}/src/tablassert/_lazy.py +0 -0
  22. {tablassert-22.3.1 → tablassert-22.3.2}/src/tablassert/biolink.py +0 -0
  23. {tablassert-22.3.1 → tablassert-22.3.2}/src/tablassert/cli_entry.py +0 -0
  24. {tablassert-22.3.1 → tablassert-22.3.2}/src/tablassert/coerce.py +0 -0
  25. {tablassert-22.3.1 → tablassert-22.3.2}/src/tablassert/data/experimental_taxa.yaml +0 -0
  26. {tablassert-22.3.1 → tablassert-22.3.2}/src/tablassert/data/infores_catalog.yaml +0 -0
  27. {tablassert-22.3.1 → tablassert-22.3.2}/src/tablassert/enums.py +0 -0
  28. {tablassert-22.3.1 → tablassert-22.3.2}/src/tablassert/errors.py +0 -0
  29. {tablassert-22.3.1 → tablassert-22.3.2}/src/tablassert/extras.py +0 -0
  30. {tablassert-22.3.1 → tablassert-22.3.2}/src/tablassert/fullmap.py +0 -0
  31. {tablassert-22.3.1 → tablassert-22.3.2}/src/tablassert/infores_registry.py +0 -0
  32. {tablassert-22.3.1 → tablassert-22.3.2}/src/tablassert/ingests.py +0 -0
  33. {tablassert-22.3.1 → tablassert-22.3.2}/src/tablassert/lib.py +0 -0
  34. {tablassert-22.3.1 → tablassert-22.3.2}/src/tablassert/log.py +0 -0
  35. {tablassert-22.3.1 → tablassert-22.3.2}/src/tablassert/models.py +0 -0
  36. {tablassert-22.3.1 → tablassert-22.3.2}/src/tablassert/net.py +0 -0
  37. {tablassert-22.3.1 → tablassert-22.3.2}/src/tablassert/nlp.py +0 -0
  38. {tablassert-22.3.1 → tablassert-22.3.2}/src/tablassert/progress.py +0 -0
  39. {tablassert-22.3.1 → tablassert-22.3.2}/src/tablassert/qc.py +0 -0
  40. {tablassert-22.3.1 → tablassert-22.3.2}/src/tablassert/rig.py +0 -0
  41. {tablassert-22.3.1 → tablassert-22.3.2}/src/tablassert/rs.pyi +0 -0
  42. {tablassert-22.3.1 → tablassert-22.3.2}/src/tablassert/runcache.py +0 -0
  43. {tablassert-22.3.1 → tablassert-22.3.2}/src/tablassert/study.py +0 -0
  44. {tablassert-22.3.1 → tablassert-22.3.2}/src/tablassert/utils.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: tablassert
3
- Version: 22.3.1
3
+ Version: 22.3.2
4
4
  Classifier: License :: OSI Approved :: Apache Software License
5
5
  Classifier: Development Status :: 5 - Production/Stable
6
6
  Classifier: Intended Audience :: Science/Research
@@ -73,20 +73,21 @@ configuration reference, and API docs.
73
73
 
74
74
  ## Statement of need
75
75
 
76
- Biomedical knowledge lives in spreadsheets: association tables, assay results, curated gene-disease
77
- lists. Getting those rows into an NCATS Translator knowledge graph means writing an ingest that maps
78
- columns to Biolink statements, resolves free text ("TP53", "lung cancer") to standard CURIEs, and
79
- records provenance, terms of use, and statistical annotations. Today that ingest is Python code
80
- maintained per source, and entity resolution usually means calling a hosted name-resolution service
81
- at build time.
82
-
83
- Tablassert replaces the per-source code with a declarative YAML mapping plus an embedded, offline
84
- entity-resolution database built from RENCI BABEL exports, so a build is reproducible, auditable,
85
- and network-free. It is aimed at Translator ingest authors and knowledge-graph data engineers who
86
- hold tabular biomedical sources, and at bioinformatics groups that want a validated KGX output
87
- without writing a transform pipeline. The configuration model and the Biolink/KGX contracts it
88
- emits follow current [`NCATSTranslator/translator-ingests`](https://github.com/NCATSTranslator/translator-ingests)
89
- practice, and each build can emit the Resource Ingest Guide (RIG) metadata those submissions require.
76
+ Biomedical knowledge graphs classically rely on bespoke ingest scripts for each source. When data
77
+ sources lack standardization, such as the millions of tables published in biomedical literature,
78
+ bespoke scripts impose three costs that limit scalability. First, mapping each table's rows,
79
+ columns, and cells to biological assertions is idiosyncratic, making them hard to inspect, review,
80
+ or reuse. Second, entity resolution may depend on hosted network services, making graph builds
81
+ unreproducible. Third, and most importantly, because each source requires a new pipeline, most
82
+ published tables are never ingested and remain neither interoperable nor reusable.
83
+
84
+ Tablassert supports knowledge-graph engineers and bioinformaticians working with tabular biomedical
85
+ sources who need standards-conformant output. Declarative YAML recipes make data-to-statement
86
+ mapping scalable, inspectable, and reusable. Batched resolution against an embedded identifier
87
+ database removes runtime service dependencies. These recipes extend beyond journal supplemental
88
+ tables to any relational source (trial registries, drug approval records, or a researcher's own
89
+ tables). Each build can emit a standardized resource descriptor, like the Resource Ingest Guide
90
+ metadata required for integration with Translator.
90
91
 
91
92
  ## Getting help
92
93
 
@@ -19,20 +19,21 @@ configuration reference, and API docs.
19
19
 
20
20
  ## Statement of need
21
21
 
22
- Biomedical knowledge lives in spreadsheets: association tables, assay results, curated gene-disease
23
- lists. Getting those rows into an NCATS Translator knowledge graph means writing an ingest that maps
24
- columns to Biolink statements, resolves free text ("TP53", "lung cancer") to standard CURIEs, and
25
- records provenance, terms of use, and statistical annotations. Today that ingest is Python code
26
- maintained per source, and entity resolution usually means calling a hosted name-resolution service
27
- at build time.
28
-
29
- Tablassert replaces the per-source code with a declarative YAML mapping plus an embedded, offline
30
- entity-resolution database built from RENCI BABEL exports, so a build is reproducible, auditable,
31
- and network-free. It is aimed at Translator ingest authors and knowledge-graph data engineers who
32
- hold tabular biomedical sources, and at bioinformatics groups that want a validated KGX output
33
- without writing a transform pipeline. The configuration model and the Biolink/KGX contracts it
34
- emits follow current [`NCATSTranslator/translator-ingests`](https://github.com/NCATSTranslator/translator-ingests)
35
- practice, and each build can emit the Resource Ingest Guide (RIG) metadata those submissions require.
22
+ Biomedical knowledge graphs classically rely on bespoke ingest scripts for each source. When data
23
+ sources lack standardization, such as the millions of tables published in biomedical literature,
24
+ bespoke scripts impose three costs that limit scalability. First, mapping each table's rows,
25
+ columns, and cells to biological assertions is idiosyncratic, making them hard to inspect, review,
26
+ or reuse. Second, entity resolution may depend on hosted network services, making graph builds
27
+ unreproducible. Third, and most importantly, because each source requires a new pipeline, most
28
+ published tables are never ingested and remain neither interoperable nor reusable.
29
+
30
+ Tablassert supports knowledge-graph engineers and bioinformaticians working with tabular biomedical
31
+ sources who need standards-conformant output. Declarative YAML recipes make data-to-statement
32
+ mapping scalable, inspectable, and reusable. Batched resolution against an embedded identifier
33
+ database removes runtime service dependencies. These recipes extend beyond journal supplemental
34
+ tables to any relational source (trial registries, drug approval records, or a researcher's own
35
+ tables). Each build can emit a standardized resource descriptor, like the Resource Ingest Guide
36
+ metadata required for integration with Translator.
36
37
 
37
38
  ## Getting help
38
39
 
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "tablassert"
3
- version = "22.3.1"
3
+ version = "22.3.2"
4
4
  description = "Tablassert turns biomedical spreadsheets (Excel, CSV, TSV) into knowledge graphs ready for NCATS Translator. Declare how your columns map to subject–predicate–object statements in YAML; Tablassert resolves free text to standard CURIEs, attaches provenance and statistical annotations, and emits KGX-compliant nodes and edges."
5
5
  authors = [
6
6
  { name = "Skye Lane Goetz", email = "sgoetz@isbscience.org" }
@@ -5,7 +5,8 @@ import re
5
5
  import subprocess
6
6
  import sys
7
7
  import time
8
- from collections.abc import Callable
8
+ from collections.abc import Callable, Iterator
9
+ from contextlib import contextmanager
9
10
  from importlib import import_module
10
11
  from importlib.metadata import version as get_version
11
12
  from itertools import chain, pairwise
@@ -35,6 +36,25 @@ else:
35
36
  pl = LazyModule("polars")
36
37
  pydantic = LazyModule("pydantic")
37
38
 
39
+
40
+ @contextmanager
41
+ def _pipeline_pool() -> Iterator[Any]:
42
+ """Drain workers normally; terminate only when a pipeline stage fails.
43
+
44
+ Pool.__exit__ terminates even successful workers, bypassing cleanup of
45
+ worker-local logging queues and leaking named semaphores under forkserver.
46
+ """
47
+ pool = Pool()
48
+ try:
49
+ yield pool
50
+ pool.close()
51
+ pool.join()
52
+ except BaseException:
53
+ pool.terminate()
54
+ pool.join()
55
+ raise
56
+
57
+
38
58
  # Pipeline completion events (BUILD, VALIDATE).
39
59
  logger = cat("PIPELINE")
40
60
  # BABEL downloader events (reuse, restart, done, retry).
@@ -320,7 +340,7 @@ def build_graph_pipeline(
320
340
  # index and we reassemble by index to keep raw[i] aligned with g.tables[i].
321
341
  start, advance, _ = progress.section_loop(len(g.tables), "Load")
322
342
  raw: list[object] = [None for _ in g.tables]
323
- with Pool() as pool:
343
+ with _pipeline_pool() as pool:
324
344
  for idx, parsed in pool.imap_unordered(_load_table_indexed, enumerate(g.tables)):
325
345
  raw[idx] = parsed
326
346
  start(str(g.tables[idx]))
@@ -332,7 +352,7 @@ def build_graph_pipeline(
332
352
  # flattened sections order is byte-identical to the old starmap result.
333
353
  start, advance, _ = progress.section_loop(len(g.tables), "Extract")
334
354
  temp: list[list[dict[str, Any]]] = [[] for _ in g.tables]
335
- with Pool() as pool:
355
+ with _pipeline_pool() as pool:
336
356
  for idx, section_list in pool.imap_unordered(_extract_sections_indexed, zip(range(len(g.tables)), raw, g.tables, strict=True)):
337
357
  temp[idx] = section_list
338
358
  start(str(g.tables[idx]))
File without changes
File without changes
File without changes
File without changes
File without changes