rcsb.workflow 0.63__tar.gz → 0.65__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 (47) hide show
  1. rcsb_workflow-0.65/.gitignore +139 -0
  2. {rcsb_workflow-0.63 → rcsb_workflow-0.65}/HISTORY.txt +3 -2
  3. {rcsb_workflow-0.63/rcsb.workflow.egg-info → rcsb_workflow-0.65}/PKG-INFO +32 -43
  4. {rcsb_workflow-0.63 → rcsb_workflow-0.65}/README.md +6 -9
  5. rcsb_workflow-0.65/pyproject.toml +103 -0
  6. rcsb_workflow-0.65/rcsb/workflow/tests/__init__.py +0 -0
  7. rcsb_workflow-0.65/rcsb/workflow/tests/fixturePdbxLoader.py +291 -0
  8. rcsb_workflow-0.65/rcsb/workflow/tests/testBcifWorkflow.py +711 -0
  9. rcsb_workflow-0.65/rcsb/workflow/tests/testChemCompFileWorkflow.py +78 -0
  10. rcsb_workflow-0.65/rcsb/workflow/tests/testChemCompImageWorkflow.py +78 -0
  11. rcsb_workflow-0.65/rcsb/workflow/tests/testChemCompSearchIndexWorkflow.py +79 -0
  12. rcsb_workflow-0.65/rcsb/workflow/tests/testExDbWorkflow.py +128 -0
  13. rcsb_workflow-0.65/rcsb/workflow/tests/testProteinTargetSequenceWorkflow.py +283 -0
  14. {rcsb_workflow-0.63 → rcsb_workflow-0.65}/rcsb/workflow/wuw/ExDbWorkflow.py +2 -0
  15. rcsb_workflow-0.65/rcsb/workflow/wuw/__init__.py +0 -0
  16. rcsb_workflow-0.63/MANIFEST.in +0 -7
  17. rcsb_workflow-0.63/PKG-INFO +0 -88
  18. rcsb_workflow-0.63/rcsb/workflow/cli/__init__.py +0 -5
  19. rcsb_workflow-0.63/rcsb.workflow.egg-info/SOURCES.txt +0 -35
  20. rcsb_workflow-0.63/rcsb.workflow.egg-info/dependency_links.txt +0 -1
  21. rcsb_workflow-0.63/rcsb.workflow.egg-info/entry_points.txt +0 -5
  22. rcsb_workflow-0.63/rcsb.workflow.egg-info/not-zip-safe +0 -1
  23. rcsb_workflow-0.63/rcsb.workflow.egg-info/requires.txt +0 -15
  24. rcsb_workflow-0.63/rcsb.workflow.egg-info/top_level.txt +0 -1
  25. rcsb_workflow-0.63/requirements.txt +0 -11
  26. rcsb_workflow-0.63/setup.cfg +0 -10
  27. rcsb_workflow-0.63/setup.py +0 -78
  28. {rcsb_workflow-0.63 → rcsb_workflow-0.65}/LICENSE +0 -0
  29. {rcsb_workflow-0.63 → rcsb_workflow-0.65}/rcsb/__init__.py +0 -0
  30. {rcsb_workflow-0.63 → rcsb_workflow-0.65}/rcsb/workflow/__init__.py +0 -0
  31. {rcsb_workflow-0.63 → rcsb_workflow-0.65}/rcsb/workflow/bcif/__init__.py +0 -0
  32. {rcsb_workflow-0.63 → rcsb_workflow-0.65}/rcsb/workflow/bcif/task_functions.py +0 -0
  33. {rcsb_workflow-0.63 → rcsb_workflow-0.65}/rcsb/workflow/chem/ChemCompFileWorkflow.py +0 -0
  34. {rcsb_workflow-0.63 → rcsb_workflow-0.65}/rcsb/workflow/chem/ChemCompImageWorkflow.py +0 -0
  35. {rcsb_workflow-0.63 → rcsb_workflow-0.65}/rcsb/workflow/chem/ChemCompSearchIndexWorkflow.py +0 -0
  36. {rcsb_workflow-0.63 → rcsb_workflow-0.65}/rcsb/workflow/chem/__init__.py +0 -0
  37. {rcsb_workflow-0.63 → rcsb_workflow-0.65}/rcsb/workflow/cli/BcifExec.py +0 -0
  38. {rcsb_workflow-0.63 → rcsb_workflow-0.65}/rcsb/workflow/cli/ChemSearchIndexExec.py +0 -0
  39. {rcsb_workflow-0.63 → rcsb_workflow-0.65}/rcsb/workflow/cli/ExDbExec.py +0 -0
  40. {rcsb_workflow-0.63 → rcsb_workflow-0.65}/rcsb/workflow/cli/ImgExec.py +0 -0
  41. {rcsb_workflow-0.63/rcsb/workflow/targets → rcsb_workflow-0.65/rcsb/workflow/cli}/__init__.py +0 -0
  42. {rcsb_workflow-0.63 → rcsb_workflow-0.65}/rcsb/workflow/targets/ProteinTargetSequenceExecutionWorkflow.py +0 -0
  43. {rcsb_workflow-0.63 → rcsb_workflow-0.65}/rcsb/workflow/targets/ProteinTargetSequenceWorkflow.py +0 -0
  44. {rcsb_workflow-0.63/rcsb/workflow/wuw → rcsb_workflow-0.65/rcsb/workflow/targets}/__init__.py +0 -0
  45. {rcsb_workflow-0.63 → rcsb_workflow-0.65}/rcsb/workflow/wuw/BcifWorkflow.py +0 -0
  46. {rcsb_workflow-0.63 → rcsb_workflow-0.65}/rcsb/workflow/wuw/PdbCsmImageWorkflow.py +0 -0
  47. {rcsb_workflow-0.63 → rcsb_workflow-0.65}/rcsb/workflow/wuw/WuwUtils.py +0 -0
@@ -0,0 +1,139 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ LOGTODAY
3
+ .idea/
4
+ .vscode/
5
+ .env/
6
+ test-output/
7
+ !test-output/.gitkeep
8
+ CACHE/
9
+ LOGTOX
10
+ Archive/
11
+
12
+ __pycache__/
13
+ *.py[cod]
14
+ *$py.class
15
+
16
+ # C extensions
17
+ *.so
18
+
19
+ # Distribution / packaging
20
+ .Python
21
+ build/
22
+ develop-eggs/
23
+ dist/
24
+ downloads/
25
+ eggs/
26
+ .eggs/
27
+ lib/
28
+ lib64/
29
+ parts/
30
+ sdist/
31
+ var/
32
+ wheels/
33
+ pip-wheel-metadata/
34
+ share/python-wheels/
35
+ *.egg-info/
36
+ .installed.cfg
37
+ *.egg
38
+ MANIFEST
39
+
40
+ # PyInstaller
41
+ # Usually these files are written by a python script from a template
42
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
43
+ *.manifest
44
+ *.spec
45
+
46
+ # Installer logs
47
+ pip-log.txt
48
+ pip-delete-this-directory.txt
49
+
50
+ # Unit test / coverage reports
51
+ htmlcov/
52
+ .tox/
53
+ .nox/
54
+ .coverage
55
+ .coverage.*
56
+ .cache
57
+ nosetests.xml
58
+ coverage.xml
59
+ *.cover
60
+ *.py,cover
61
+ .hypothesis/
62
+ .pytest_cache/
63
+
64
+ # Translations
65
+ *.mo
66
+ *.pot
67
+
68
+ # Django stuff:
69
+ *.log
70
+ local_settings.py
71
+ db.sqlite3
72
+ db.sqlite3-journal
73
+
74
+ # Flask stuff:
75
+ instance/
76
+ .webassets-cache
77
+
78
+ # Scrapy stuff:
79
+ .scrapy
80
+
81
+ # Sphinx documentation
82
+ docs/_build/
83
+
84
+ # PyBuilder
85
+ target/
86
+
87
+ # Jupyter Notebook
88
+ .ipynb_checkpoints
89
+
90
+ # IPython
91
+ profile_default/
92
+ ipython_config.py
93
+
94
+ # pyenv
95
+ .python-version
96
+
97
+ # pipenv
98
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
99
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
100
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
101
+ # install all needed dependencies.
102
+ #Pipfile.lock
103
+
104
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow
105
+ __pypackages__/
106
+
107
+ # Celery stuff
108
+ celerybeat-schedule
109
+ celerybeat.pid
110
+
111
+ # SageMath parsed files
112
+ *.sage.py
113
+
114
+ # Environments
115
+ .env
116
+ .venv
117
+ env/
118
+ venv/
119
+ ENV/
120
+ env.bak/
121
+ venv.bak/
122
+
123
+ # Spyder project settings
124
+ .spyderproject
125
+ .spyproject
126
+
127
+ # Rope project settings
128
+ .ropeproject
129
+
130
+ # mkdocs documentation
131
+ /site
132
+
133
+ # mypy
134
+ .mypy_cache/
135
+ .dmypy.json
136
+ dmypy.json
137
+
138
+ # Pyre type checker
139
+ .pyre/
@@ -56,5 +56,6 @@
56
56
  4-Sep-2025 - V0.60 Update requirements and docker file
57
57
  10-Sep-2025 - V0.61 Return without error in bcif task functions, update content prefixes
58
58
  30-Sep-2025 - V0.62 Let jpg gen use model file over URL
59
- 9-Sep-2025 - V0.63 Add ChemSearchIndex from weekly-update-workflow so it can be a cli call instead
60
-
59
+ 15-Oct-2025 - V0.63 Add ChemSearchIndex from weekly-update-workflow so it can be a cli call instead
60
+ 8-Dec-2025 - V0.64 Switch to 'pyproject.toml' file and update test pipelines to python 3.12
61
+ 6-Jan-2026 - V0.65 Reduce resource utilization for test suites
@@ -1,45 +1,37 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: rcsb.workflow
3
- Version: 0.63
3
+ Version: 0.65
4
4
  Summary: RCSB Python data processing and ETL/ELT workflow entry points
5
- Home-page: https://github.com/rcsb/py-rcsb_workflow
6
- Author: John Westbrook
7
- Author-email: john.westbrook@rcsb.org
8
- License: Apache 2.0
9
- Classifier: Development Status :: 3 - Alpha
5
+ Project-URL: Homepage, https://github.com/rcsb/py-rcsb_workflow
6
+ Author-email: John Westbrook <john.westbrook@rcsb.org>
7
+ Maintainer-email: Dennis Piehl <dennis.piehl@rcsb.org>, Michael Trumbull <michael.trumbull@rcsb.org>, James Smith <james.smith@rcsb.org>
8
+ License-Expression: Apache-2.0
9
+ License-File: LICENSE
10
+ Classifier: Development Status :: 5 - Production/Stable
10
11
  Classifier: Intended Audience :: Developers
11
12
  Classifier: Natural Language :: English
12
- Classifier: License :: OSI Approved :: Apache Software License
13
13
  Classifier: Programming Language :: Python
14
14
  Classifier: Programming Language :: Python :: 3
15
- Classifier: Programming Language :: Python :: 3.9
16
- Classifier: Programming Language :: Python :: 3.10
17
- Description-Content-Type: text/markdown
18
- License-File: LICENSE
19
- Requires-Dist: rcsb.utils.chem>=0.82
20
- Requires-Dist: rcsb.utils.seq>=0.84
21
- Requires-Dist: rcsb.utils.targets>=0.83
22
- Requires-Dist: rcsb.utils.seqalign>=0.31
23
- Requires-Dist: rcsb.utils.io>=1.49
24
- Requires-Dist: rcsb.exdb>=1.30
25
- Requires-Dist: rcsb.db>=1.808
15
+ Classifier: Programming Language :: Python :: 3.12
16
+ Requires-Python: >=3.9
17
+ Requires-Dist: mmcif>=1.0.0
18
+ Requires-Dist: openeye-toolkits>=2024.1.1
19
+ Requires-Dist: rcsb-db>=1.812
20
+ Requires-Dist: rcsb-exdb>=1.33
21
+ Requires-Dist: rcsb-utils-chem>=0.84
22
+ Requires-Dist: rcsb-utils-io>=1.49
23
+ Requires-Dist: rcsb-utils-seq>=0.84
24
+ Requires-Dist: rcsb-utils-seqalign>=0.32
25
+ Requires-Dist: rcsb-utils-targets>=0.83
26
26
  Requires-Dist: requests>=2.32.3
27
- Requires-Dist: mmcif>=0.91.0
28
- Provides-Extra: dev
29
- Requires-Dist: check-manifest; extra == "dev"
30
- Provides-Extra: test
31
- Requires-Dist: coverage; extra == "test"
32
- Dynamic: author
33
- Dynamic: author-email
34
- Dynamic: classifier
35
- Dynamic: description
36
- Dynamic: description-content-type
37
- Dynamic: home-page
38
- Dynamic: license
39
- Dynamic: license-file
40
- Dynamic: provides-extra
41
- Dynamic: requires-dist
42
- Dynamic: summary
27
+ Provides-Extra: tests
28
+ Requires-Dist: black>=21.5b1; extra == 'tests'
29
+ Requires-Dist: check-manifest; extra == 'tests'
30
+ Requires-Dist: coverage; extra == 'tests'
31
+ Requires-Dist: flake8; extra == 'tests'
32
+ Requires-Dist: pylint; extra == 'tests'
33
+ Requires-Dist: tox; extra == 'tests'
34
+ Description-Content-Type: text/markdown
43
35
 
44
36
  # py-rcsb_workflow
45
37
 
@@ -63,18 +55,11 @@ git submodule update --recursive --remote
63
55
 
64
56
  ```
65
57
 
66
- Optionally, run test suite (Python versions 3.8) using
67
- [setuptools](https://setuptools.readthedocs.io/en/latest/) or
58
+ Optionally, run test suite (Python versions >= 3.9) using
68
59
  [tox](http://tox.readthedocs.io/en/latest/example/platform.html):
69
60
 
70
61
  ```bash
71
-
72
- pip install -r requirements.txt
73
- python setup.py test
74
-
75
- or simply run:
76
-
77
- tox
62
+ tox
78
63
  ```
79
64
 
80
65
  Installation is via the program [pip](https://pypi.python.org/pypi/pip).
@@ -85,4 +70,8 @@ pip install rcsb.workflow --extra-index-url https://pypi.anaconda.org/OpenEye/si
85
70
  To run tests from the source tree, the package must be installed in editable mode (i.e. -e):
86
71
  ```bash
87
72
  pip install -e . --extra-index-url https://pypi.anaconda.org/OpenEye/simple
73
+
74
+ # or using uv
75
+
76
+ uv pip install -e .
88
77
  ```
@@ -20,18 +20,11 @@ git submodule update --recursive --remote
20
20
 
21
21
  ```
22
22
 
23
- Optionally, run test suite (Python versions 3.8) using
24
- [setuptools](https://setuptools.readthedocs.io/en/latest/) or
23
+ Optionally, run test suite (Python versions >= 3.9) using
25
24
  [tox](http://tox.readthedocs.io/en/latest/example/platform.html):
26
25
 
27
26
  ```bash
28
-
29
- pip install -r requirements.txt
30
- python setup.py test
31
-
32
- or simply run:
33
-
34
- tox
27
+ tox
35
28
  ```
36
29
 
37
30
  Installation is via the program [pip](https://pypi.python.org/pypi/pip).
@@ -42,4 +35,8 @@ pip install rcsb.workflow --extra-index-url https://pypi.anaconda.org/OpenEye/si
42
35
  To run tests from the source tree, the package must be installed in editable mode (i.e. -e):
43
36
  ```bash
44
37
  pip install -e . --extra-index-url https://pypi.anaconda.org/OpenEye/simple
38
+
39
+ # or using uv
40
+
41
+ uv pip install -e .
45
42
  ```
@@ -0,0 +1,103 @@
1
+ [build-system]
2
+ requires = ["hatchling"]
3
+ build-backend = "hatchling.build"
4
+
5
+ [project]
6
+ name = "rcsb.workflow"
7
+ description = "RCSB Python data processing and ETL/ELT workflow entry points"
8
+ version = "0.65"
9
+ readme = "README.md"
10
+ authors = [
11
+ { name="John Westbrook", email="john.westbrook@rcsb.org" }
12
+ ]
13
+ maintainers = [
14
+ { name="Dennis Piehl", email="dennis.piehl@rcsb.org" },
15
+ { name="Michael Trumbull", email="michael.trumbull@rcsb.org" },
16
+ { name="James Smith", email="james.smith@rcsb.org" }
17
+ ]
18
+ license = "Apache-2.0"
19
+ license-files = ["LICENSE"]
20
+ requires-python = ">=3.9" # Latest OpenEye (2025.1.1) only supports up to 3.12 (as of Nov. 2025)
21
+ classifiers = [
22
+ "Development Status :: 5 - Production/Stable",
23
+ "Intended Audience :: Developers",
24
+ "Natural Language :: English",
25
+ "Programming Language :: Python",
26
+ "Programming Language :: Python :: 3",
27
+ "Programming Language :: Python :: 3.12", # Latest OpenEye (2025.1.1) only supports up to 3.12 (as of Nov. 2025)
28
+ ]
29
+
30
+ dependencies = [
31
+ # OpenEye is needed here despite it not being a direct requirement of this package (it's used by rcsb.utils.chem)
32
+ "OpenEye-toolkits >= 2024.1.1",
33
+ #
34
+ "mmcif >= 1.0.0",
35
+ "rcsb.utils.io >= 1.49",
36
+ "rcsb.db >= 1.812",
37
+ "rcsb.utils.chem >= 0.84",
38
+ "rcsb.utils.seq >= 0.84",
39
+ "rcsb.utils.targets >= 0.83",
40
+ "rcsb.utils.seqalign >= 0.32",
41
+ "rcsb.exdb >= 1.33",
42
+ "requests >= 2.32.3",
43
+ ]
44
+
45
+ [project.optional-dependencies]
46
+ tests = ["tox", "pylint", "black>=21.5b1", "flake8", "coverage", "check-manifest"]
47
+
48
+ [project.urls]
49
+ Homepage = "https://github.com/rcsb/py-rcsb_workflow"
50
+
51
+ [project.scripts]
52
+ exdb_wf_cli = "rcsb.workflow.cli.ExDbExec:main"
53
+ imgs_exec_cli = "rcsb.workflow.cli.ImgExec:main"
54
+ bcif_exec_cli = "rcsb.workflow.cli.BcifExec:main"
55
+ chem_search_index_cli = "rcsb.workflow.cli.ChemSearchIndexExec:main"
56
+
57
+
58
+ # ---------------- hatch configuration ----------------
59
+ [tool.hatch.build.targets.sdist]
60
+ include = [
61
+ "/rcsb/**",
62
+ "/README.md",
63
+ "/LICENSE",
64
+ "/HISTORY.txt",
65
+ "/pyproject.toml",
66
+ ]
67
+ exclude = [
68
+ "/rcsb/mock-*",
69
+ "/rcsb/workflow/test*/test*-*",
70
+ "/rcsb/workflow/test*/**.tdd",
71
+ "/rcsb/workflow/test*/**.txt",
72
+ "/rcsb/workflow/test*/**.sh",
73
+ "/rcsb/workflow/test*/**.gz",
74
+ "/rcsb/workflow/test*/**.pic",
75
+ "/rcsb/workflow/test*/**.cif",
76
+ "/rcsb/workflow/test*/**.json",
77
+ ]
78
+
79
+ [tool.hatch.build.targets.wheel]
80
+ packages = ["rcsb"]
81
+ exclude = [
82
+ "/rcsb/workflow/test*",
83
+ "/rcsb/mock-*",
84
+ ]
85
+
86
+ [tool.hatch.envs.default]
87
+ skip-install = true
88
+ dependencies = ["OpenEye-toolkits>=2024.1.1"]
89
+
90
+ [tool.hatch.envs.default.env-vars]
91
+ PIP_EXTRA_INDEX_URL = "https://pypi.anaconda.org/OpenEye/simple"
92
+
93
+ # ---------------- test configuration ----------------
94
+ [tool.hatch.envs.hatch-test]
95
+ dependencies = ["tox"]
96
+
97
+ [tool.hatch.envs.hatch-test.scripts]
98
+ run = ["tox"]
99
+
100
+ # ---------------- UV configuration ----------------
101
+ [tool.uv]
102
+ extra-index-url = ["https://pypi.anaconda.org/OpenEye/simple"]
103
+ managed = false # This prevents uv from automatically creating venvs within individual packages when running 'uv run ...' from within the package directory
File without changes
@@ -0,0 +1,291 @@
1
+ ##
2
+ # File: PdbxLoaderFixture.py
3
+ # Author: J. Westbrook
4
+ # Date: 4-Sep-2019
5
+ # Version: 0.001
6
+ #
7
+ # Updates:
8
+ # 04-Feb-2025 mjt Copied this file over from rcsb.exdb
9
+ ##
10
+ """
11
+ Fixture for loading the chemical reference and pdbx_core collections in a loca mongo instance.
12
+
13
+ """
14
+
15
+ __docformat__ = "google en"
16
+ __author__ = "John Westbrook"
17
+ __email__ = "jwest@rcsb.rutgers.edu"
18
+ __license__ = "Apache 2.0"
19
+
20
+ # import glob
21
+ import logging
22
+ import os
23
+ import platform
24
+ import resource
25
+ import time
26
+ import unittest
27
+ import shutil
28
+
29
+ from rcsb.db.mongo.DocumentLoader import DocumentLoader
30
+ from rcsb.db.mongo.PdbxLoader import PdbxLoader
31
+ from rcsb.utils.config.ConfigUtil import ConfigUtil
32
+ # from rcsb.utils.io.FileUtil import FileUtil
33
+
34
+ logging.basicConfig(level=logging.INFO, format="%(asctime)s [%(levelname)s]-%(module)s.%(funcName)s: %(message)s")
35
+ logger = logging.getLogger()
36
+ logger.setLevel(logging.INFO)
37
+
38
+ HERE = os.path.abspath(os.path.dirname(__file__))
39
+ TOPDIR = os.path.dirname(os.path.dirname(os.path.dirname(HERE)))
40
+
41
+
42
+ class PdbxLoaderFixture(unittest.TestCase):
43
+
44
+ def __init__(self, methodName="runTest"):
45
+ super(PdbxLoaderFixture, self).__init__(methodName)
46
+ self.__verbose = True
47
+
48
+ def setUp(self):
49
+ #
50
+ #
51
+ self.__isMac = platform.system() == "Darwin"
52
+ self.__excludeTypeL = None if self.__isMac else ["optional"]
53
+ self.__mockTopPath = os.path.join(TOPDIR, "rcsb", "mock-data")
54
+ configPath = os.path.join(TOPDIR, "rcsb", "mock-data", "config", "dbload-setup-example.yml")
55
+ # configPath = os.path.join(TOPDIR, "rcsb", "mock-data", "config", "dbload-setup-example-local.yml")
56
+ # To Do: Investigate why GitUtil sometimes gives divergence error when using 'DISCOVERY_MODE: remote', but not with 'local':
57
+ # stderr: 'fatal: Need to specify how to reconcile divergent branches.'
58
+ # Behavior isn't entirely predictable, since it happens sometimes but not all the time.
59
+ # To fully debug, will need to add more logging statements to GitUtil, StashableBase, & StashUtil (in rcsb.utils.io)
60
+ # Or, can try to resolve error directly by specifying how to reconcile diverent branches in git.Repo class.
61
+ configName = "site_info_configuration"
62
+ self.__cfgOb = ConfigUtil(configPath=configPath, defaultSectionName=configName, mockTopPath=self.__mockTopPath)
63
+ #
64
+ self._disk_before = shutil.disk_usage(HERE).used
65
+ logger.info("Filesystem disk usage start: %.2f MB", self._disk_before / (1024 ** 2))
66
+ #
67
+ self.__resourceName = "MONGO_DB"
68
+ self.__failedFilePath = os.path.join(HERE, "test-output", "failed-list.txt")
69
+ self.__cachePath = os.path.join(TOPDIR, "CACHE")
70
+ self.__readBackCheck = True
71
+ self.__numProc = 1
72
+ self.__chunkSize = 2
73
+ self.__fileLimit = 38
74
+ self.__documentStyle = "rowwise_by_name_with_cardinality"
75
+ #
76
+ self.__birdChemCompCoreIdList = [
77
+ "PRD_000010",
78
+ "PRD_000060",
79
+ "PRD_000220",
80
+ "PRD_000882",
81
+ "PRD_000154",
82
+ "PRD_000877",
83
+ "PRD_000198",
84
+ "PRD_000009",
85
+ "PRD_000979",
86
+ "PRDCC_000010",
87
+ "PRDCC_000220",
88
+ "PRDCC_000882",
89
+ "PRDCC_000154",
90
+ "PRDCC_000198",
91
+ "PRDCC_000009",
92
+ "FAM_000010",
93
+ "FAM_000210",
94
+ "FAM_000220",
95
+ "FAM_000001",
96
+ "FAM_000391",
97
+ "FAM_000093",
98
+ "FAM_000084",
99
+ "FAM_000016",
100
+ "FAM_000336",
101
+ "1G1",
102
+ "2RT",
103
+ "2XL",
104
+ "2XN",
105
+ "ATP",
106
+ "BJA",
107
+ "BM3",
108
+ "CNC",
109
+ "DAL",
110
+ "DDZ",
111
+ "DHA",
112
+ "DSN",
113
+ "GTP",
114
+ "HKL",
115
+ "NAC",
116
+ "NAG",
117
+ "NND",
118
+ "PTR",
119
+ "SEP",
120
+ "SMJ",
121
+ "STL",
122
+ "UNK",
123
+ "UNX",
124
+ "UVL",
125
+ ]
126
+ #
127
+ self.__pdbIdList = [
128
+ "1AH1",
129
+ "1B5F",
130
+ "1BMV",
131
+ "1C58",
132
+ "1DSR",
133
+ "1DUL",
134
+ "1KQE",
135
+ "1O3Q",
136
+ "1SFO",
137
+ "2HW3",
138
+ "2HYV",
139
+ "2OSL",
140
+ "2VOO",
141
+ "2WMG",
142
+ "3AD7",
143
+ "3HYA",
144
+ "3IYD",
145
+ "3MBG",
146
+ "3RER",
147
+ "3VD8",
148
+ "3VFJ",
149
+ "3X11",
150
+ "3ZTJ",
151
+ "4E2O",
152
+ "4EN8",
153
+ "4MEY",
154
+ "5EU8",
155
+ "5KDS",
156
+ # "5TM0",
157
+ "5VH4",
158
+ # "5VP2",
159
+ # "6FSZ",
160
+ "6LU7",
161
+ "6NN7",
162
+ # "6Q20",
163
+ "6RFK",
164
+ "6RKU",
165
+ "6YRQ",
166
+ ]
167
+ self.__ldList = [
168
+ {
169
+ # "databaseName": "dw",
170
+ "collectionGroupName": "core_chem_comp",
171
+ "contentType": "bird_chem_comp_core",
172
+ "collectionNameList": None,
173
+ "loadType": "full",
174
+ "mergeContentTypes": None,
175
+ "validationLevel": "min",
176
+ "inputIdCodeList": self.__birdChemCompCoreIdList
177
+ },
178
+ {
179
+ # "databaseName": "pdbx_core",
180
+ "collectionGroupName": "pdbx_core",
181
+ "contentType": "pdbx_core",
182
+ "collectionNameList": None,
183
+ "loadType": "replace",
184
+ "mergeContentTypes": ["vrpt"],
185
+ "validationLevel": "min",
186
+ "inputIdCodeList": self.__pdbIdList
187
+ },
188
+ # {
189
+ # "databaseName": "pdbx_comp_model_core",
190
+ # "collectionNameList": None,
191
+ # "loadType": "full",
192
+ # "mergeContentTypes": None,
193
+ # "validationLevel": "min",
194
+ # "inputIdCodeList": None
195
+ # },
196
+ ]
197
+ #
198
+ # self.__modelFixture()
199
+ self.__startTime = time.time()
200
+ logger.debug("Starting %s at %s", self.id(), time.strftime("%Y %m %d %H:%M:%S", time.localtime()))
201
+
202
+ def tearDown(self):
203
+ unitS = "MB" if platform.system() == "Darwin" else "GB"
204
+ rusageMax = resource.getrusage(resource.RUSAGE_SELF).ru_maxrss
205
+ logger.info("Maximum resident memory size %.4f %s", rusageMax / 10 ** 6, unitS)
206
+ endTime = time.time()
207
+ disk_after = shutil.disk_usage(HERE).used
208
+ disk_delta = disk_after - self._disk_before
209
+ logger.info("Filesystem disk usage delta: %.2f MB", disk_delta / (1024 ** 2))
210
+ logger.info("Completed %s at %s (%.4f seconds)", self.id(), time.strftime("%Y %m %d %H:%M:%S", time.localtime()), endTime - self.__startTime)
211
+
212
+ def testPdbxLoader(self):
213
+ #
214
+ for ld in self.__ldList:
215
+ ok = self.__pdbxLoaderWrapper(**ld)
216
+ self.assertTrue(ok)
217
+
218
+ def __pdbxLoaderWrapper(self, **kwargs):
219
+ """Wrapper for the PDBx loader module"""
220
+ ok = False
221
+ try:
222
+ logger.info("Loading %s", kwargs["collectionGroupName"])
223
+ mw = PdbxLoader(
224
+ self.__cfgOb,
225
+ cachePath=self.__cachePath,
226
+ resourceName=self.__resourceName,
227
+ numProc=self.__numProc,
228
+ chunkSize=self.__chunkSize,
229
+ fileLimit=kwargs.get("fileLimit", self.__fileLimit),
230
+ verbose=self.__verbose,
231
+ readBackCheck=self.__readBackCheck,
232
+ maxStepLength=1000,
233
+ useSchemaCache=True,
234
+ rebuildSchemaFlag=False,
235
+ )
236
+ ok = mw.load(
237
+ collectionGroupName=kwargs["collectionGroupName"],
238
+ collectionLoadList=kwargs["collectionNameList"],
239
+ contentType=kwargs["contentType"],
240
+ loadType=kwargs["loadType"],
241
+ inputPathList=None,
242
+ inputIdCodeList=kwargs["inputIdCodeList"],
243
+ styleType=self.__documentStyle,
244
+ dataSelectors=["PUBLIC_RELEASE"],
245
+ failedFilePath=self.__failedFilePath,
246
+ saveInputFileListPath=None,
247
+ pruneDocumentSize=None,
248
+ logSize=False,
249
+ validationLevel=kwargs["validationLevel"],
250
+ mergeContentTypes=kwargs["mergeContentTypes"],
251
+ useNameFlag=False,
252
+ providerTypeExcludeL=self.__excludeTypeL,
253
+ restoreUseGit=True,
254
+ restoreUseStash=False,
255
+ )
256
+ self.assertTrue(ok)
257
+ ok = self.__loadStatus(mw.getLoadStatus())
258
+ self.assertTrue(ok)
259
+ except Exception as e:
260
+ logger.exception("Failing with %s", str(e))
261
+ self.fail()
262
+ return ok
263
+
264
+ def __loadStatus(self, statusList):
265
+ sectionName = "data_exchange_configuration"
266
+ dl = DocumentLoader(
267
+ self.__cfgOb,
268
+ self.__cachePath,
269
+ resourceName=self.__resourceName,
270
+ numProc=self.__numProc,
271
+ chunkSize=self.__chunkSize,
272
+ documentLimit=None,
273
+ verbose=self.__verbose,
274
+ readBackCheck=self.__readBackCheck,
275
+ )
276
+ #
277
+ databaseName = self.__cfgOb.get("DATABASE_NAME", sectionName=sectionName)
278
+ collectionName = self.__cfgOb.get("COLLECTION_UPDATE_STATUS", sectionName=sectionName)
279
+ ok = dl.load(databaseName, collectionName, loadType="append", documentList=statusList, indexAttributeList=["update_id", "database_name", "object_name"], keyNames=None)
280
+ return ok
281
+
282
+
283
+ def mongoLoadPdbxSuite():
284
+ suiteSelect = unittest.TestSuite()
285
+ suiteSelect.addTest(PdbxLoaderFixture("testPdbxLoader"))
286
+ return suiteSelect
287
+
288
+
289
+ if __name__ == "__main__":
290
+ mySuite = mongoLoadPdbxSuite()
291
+ unittest.TextTestRunner(verbosity=2).run(mySuite)