nmdc-runtime 2.9.0__py3-none-any.whl → 2.11.0__py3-none-any.whl

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.

Potentially problematic release.


This version of nmdc-runtime might be problematic. Click here for more details.

Files changed (131) hide show
  1. nmdc_runtime/Dockerfile +167 -0
  2. nmdc_runtime/api/analytics.py +90 -0
  3. nmdc_runtime/api/boot/capabilities.py +9 -0
  4. nmdc_runtime/api/boot/object_types.py +126 -0
  5. nmdc_runtime/api/boot/triggers.py +84 -0
  6. nmdc_runtime/api/boot/workflows.py +116 -0
  7. nmdc_runtime/api/core/auth.py +208 -0
  8. nmdc_runtime/api/core/idgen.py +200 -0
  9. nmdc_runtime/api/core/metadata.py +788 -0
  10. nmdc_runtime/api/core/util.py +109 -0
  11. nmdc_runtime/api/db/mongo.py +435 -0
  12. nmdc_runtime/api/db/s3.py +37 -0
  13. nmdc_runtime/api/endpoints/capabilities.py +25 -0
  14. nmdc_runtime/api/endpoints/find.py +634 -0
  15. nmdc_runtime/api/endpoints/jobs.py +143 -0
  16. nmdc_runtime/api/endpoints/lib/helpers.py +274 -0
  17. nmdc_runtime/api/endpoints/lib/linked_instances.py +180 -0
  18. nmdc_runtime/api/endpoints/lib/path_segments.py +165 -0
  19. nmdc_runtime/api/endpoints/metadata.py +260 -0
  20. nmdc_runtime/api/endpoints/nmdcschema.py +502 -0
  21. nmdc_runtime/api/endpoints/object_types.py +38 -0
  22. nmdc_runtime/api/endpoints/objects.py +270 -0
  23. nmdc_runtime/api/endpoints/operations.py +78 -0
  24. nmdc_runtime/api/endpoints/queries.py +701 -0
  25. nmdc_runtime/api/endpoints/runs.py +98 -0
  26. nmdc_runtime/api/endpoints/search.py +38 -0
  27. nmdc_runtime/api/endpoints/sites.py +205 -0
  28. nmdc_runtime/api/endpoints/triggers.py +25 -0
  29. nmdc_runtime/api/endpoints/users.py +214 -0
  30. nmdc_runtime/api/endpoints/util.py +796 -0
  31. nmdc_runtime/api/endpoints/workflows.py +353 -0
  32. nmdc_runtime/api/entrypoint.sh +7 -0
  33. nmdc_runtime/api/main.py +425 -0
  34. nmdc_runtime/api/middleware.py +43 -0
  35. nmdc_runtime/api/models/capability.py +14 -0
  36. nmdc_runtime/api/models/id.py +92 -0
  37. nmdc_runtime/api/models/job.py +37 -0
  38. nmdc_runtime/api/models/lib/helpers.py +78 -0
  39. nmdc_runtime/api/models/metadata.py +11 -0
  40. nmdc_runtime/api/models/nmdc_schema.py +146 -0
  41. nmdc_runtime/api/models/object.py +180 -0
  42. nmdc_runtime/api/models/object_type.py +20 -0
  43. nmdc_runtime/api/models/operation.py +66 -0
  44. nmdc_runtime/api/models/query.py +246 -0
  45. nmdc_runtime/api/models/query_continuation.py +111 -0
  46. nmdc_runtime/api/models/run.py +161 -0
  47. nmdc_runtime/api/models/site.py +87 -0
  48. nmdc_runtime/api/models/trigger.py +13 -0
  49. nmdc_runtime/api/models/user.py +140 -0
  50. nmdc_runtime/api/models/util.py +260 -0
  51. nmdc_runtime/api/models/workflow.py +15 -0
  52. nmdc_runtime/api/openapi.py +178 -0
  53. nmdc_runtime/api/swagger_ui/assets/custom-elements.js +522 -0
  54. nmdc_runtime/api/swagger_ui/assets/script.js +247 -0
  55. nmdc_runtime/api/swagger_ui/assets/style.css +155 -0
  56. nmdc_runtime/api/swagger_ui/swagger_ui.py +34 -0
  57. nmdc_runtime/config.py +7 -8
  58. nmdc_runtime/minter/adapters/repository.py +22 -2
  59. nmdc_runtime/minter/config.py +2 -0
  60. nmdc_runtime/minter/domain/model.py +55 -1
  61. nmdc_runtime/minter/entrypoints/fastapi_app.py +1 -1
  62. nmdc_runtime/mongo_util.py +1 -2
  63. nmdc_runtime/site/backup/nmdcdb_mongodump.py +1 -1
  64. nmdc_runtime/site/backup/nmdcdb_mongoexport.py +1 -3
  65. nmdc_runtime/site/changesheets/data/OmicsProcessing-to-catted-Biosamples.tsv +1561 -0
  66. nmdc_runtime/site/changesheets/scripts/missing_neon_soils_ecosystem_data.py +311 -0
  67. nmdc_runtime/site/changesheets/scripts/neon_soils_add_ncbi_ids.py +210 -0
  68. nmdc_runtime/site/dagster.yaml +53 -0
  69. nmdc_runtime/site/entrypoint-daemon.sh +26 -0
  70. nmdc_runtime/site/entrypoint-dagit-readonly.sh +26 -0
  71. nmdc_runtime/site/entrypoint-dagit.sh +26 -0
  72. nmdc_runtime/site/export/ncbi_xml.py +633 -13
  73. nmdc_runtime/site/export/ncbi_xml_utils.py +115 -1
  74. nmdc_runtime/site/graphs.py +8 -22
  75. nmdc_runtime/site/ops.py +147 -181
  76. nmdc_runtime/site/repository.py +2 -112
  77. nmdc_runtime/site/resources.py +16 -3
  78. nmdc_runtime/site/translation/gold_translator.py +4 -12
  79. nmdc_runtime/site/translation/neon_benthic_translator.py +0 -1
  80. nmdc_runtime/site/translation/neon_soil_translator.py +4 -5
  81. nmdc_runtime/site/translation/neon_surface_water_translator.py +0 -2
  82. nmdc_runtime/site/translation/submission_portal_translator.py +84 -68
  83. nmdc_runtime/site/translation/translator.py +63 -1
  84. nmdc_runtime/site/util.py +8 -3
  85. nmdc_runtime/site/validation/util.py +10 -5
  86. nmdc_runtime/site/workspace.yaml +13 -0
  87. nmdc_runtime/static/NMDC_logo.svg +1073 -0
  88. nmdc_runtime/static/ORCID-iD_icon_vector.svg +4 -0
  89. nmdc_runtime/static/README.md +5 -0
  90. nmdc_runtime/static/favicon.ico +0 -0
  91. nmdc_runtime/util.py +90 -48
  92. nmdc_runtime-2.11.0.dist-info/METADATA +46 -0
  93. nmdc_runtime-2.11.0.dist-info/RECORD +128 -0
  94. {nmdc_runtime-2.9.0.dist-info → nmdc_runtime-2.11.0.dist-info}/WHEEL +1 -2
  95. nmdc_runtime/containers.py +0 -14
  96. nmdc_runtime/core/db/Database.py +0 -15
  97. nmdc_runtime/core/exceptions/__init__.py +0 -23
  98. nmdc_runtime/core/exceptions/base.py +0 -47
  99. nmdc_runtime/core/exceptions/token.py +0 -13
  100. nmdc_runtime/domain/users/queriesInterface.py +0 -18
  101. nmdc_runtime/domain/users/userSchema.py +0 -37
  102. nmdc_runtime/domain/users/userService.py +0 -14
  103. nmdc_runtime/infrastructure/database/db.py +0 -3
  104. nmdc_runtime/infrastructure/database/models/user.py +0 -10
  105. nmdc_runtime/lib/__init__.py +0 -1
  106. nmdc_runtime/lib/extract_nmdc_data.py +0 -41
  107. nmdc_runtime/lib/load_nmdc_data.py +0 -121
  108. nmdc_runtime/lib/nmdc_dataframes.py +0 -829
  109. nmdc_runtime/lib/nmdc_etl_class.py +0 -402
  110. nmdc_runtime/lib/transform_nmdc_data.py +0 -1117
  111. nmdc_runtime/site/drsobjects/ingest.py +0 -93
  112. nmdc_runtime/site/drsobjects/registration.py +0 -131
  113. nmdc_runtime/site/translation/emsl.py +0 -43
  114. nmdc_runtime/site/translation/gold.py +0 -53
  115. nmdc_runtime/site/translation/jgi.py +0 -32
  116. nmdc_runtime/site/translation/util.py +0 -132
  117. nmdc_runtime/site/validation/jgi.py +0 -43
  118. nmdc_runtime-2.9.0.dist-info/METADATA +0 -214
  119. nmdc_runtime-2.9.0.dist-info/RECORD +0 -84
  120. nmdc_runtime-2.9.0.dist-info/top_level.txt +0 -1
  121. /nmdc_runtime/{client → api}/__init__.py +0 -0
  122. /nmdc_runtime/{core → api/boot}/__init__.py +0 -0
  123. /nmdc_runtime/{core/db → api/core}/__init__.py +0 -0
  124. /nmdc_runtime/{domain → api/db}/__init__.py +0 -0
  125. /nmdc_runtime/{domain/users → api/endpoints}/__init__.py +0 -0
  126. /nmdc_runtime/{infrastructure → api/endpoints/lib}/__init__.py +0 -0
  127. /nmdc_runtime/{infrastructure/database → api/models}/__init__.py +0 -0
  128. /nmdc_runtime/{infrastructure/database/models → api/models/lib}/__init__.py +0 -0
  129. /nmdc_runtime/{site/drsobjects/__init__.py → api/models/minter.py} +0 -0
  130. {nmdc_runtime-2.9.0.dist-info → nmdc_runtime-2.11.0.dist-info}/entry_points.txt +0 -0
  131. {nmdc_runtime-2.9.0.dist-info → nmdc_runtime-2.11.0.dist-info}/licenses/LICENSE +0 -0
@@ -0,0 +1,4 @@
1
+ <svg width="32" height="32" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M32 16c0 8.837-7.163 16-16 16-8.838 0-16-7.163-16-16C0 7.162 7.162 0 16 0c8.837 0 16 7.162 16 16Z" fill="#A6CE39"/>
3
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M18.813 9.637h-5.45v13.9h5.474c4.555 0 7.35-3.378 7.35-6.95 0-1.635-.562-3.372-1.77-4.704-1.215-1.336-3.065-2.246-5.605-2.246ZM18.6 21.3h-2.813v-9.425H18.5c1.823 0 3.12.552 3.96 1.4.842.849 1.252 2.021 1.252 3.312 0 .784-.239 1.967-.993 2.948-.745.969-2.01 1.765-4.119 1.765Zm5.311-4.026c-.251 1.74-1.494 4.276-5.311 4.276h-3.063H18.6c3.817 0 5.06-2.536 5.311-4.276Zm1.812-2.405c-.657-2.601-2.85-4.982-6.91-4.982h-5.2 5.2c4.06 0 6.253 2.38 6.91 4.982Zm.215 1.718ZM8.363 9.675v13.887h2.425V9.675H8.363Zm2.175 13.637H8.612h1.925ZM9.575 8.65c.84 0 1.513-.689 1.513-1.513 0-.823-.673-1.512-1.513-1.512-.838 0-1.512.674-1.512 1.513 0 .823.672 1.512 1.512 1.512Z" fill="#fff"/>
4
+ </svg>
@@ -0,0 +1,5 @@
1
+ # Static
2
+
3
+ This document contains information about the origins of the other files in this directory.
4
+
5
+ - `ORCID-iD_icon_vector.svg`: On September 27, 2025, we downloaded this SVG file from ORCID's [Brand Library](https://orcid.filecamp.com/s/o/3CCuLloCl73Knntn/VU19wHSMUnX9TD4R), which we found a link to on the [Brand Guidelines](https://info.orcid.org/brand-guidelines/) page of ORCID's website.
Binary file
nmdc_runtime/util.py CHANGED
@@ -2,6 +2,7 @@ import json
2
2
  import mimetypes
3
3
  import os
4
4
  import pkgutil
5
+ from collections import defaultdict
5
6
  from collections.abc import Iterable
6
7
  from copy import deepcopy
7
8
  from datetime import datetime, timezone
@@ -13,13 +14,16 @@ from typing import Callable, List, Optional, Set, Dict
13
14
 
14
15
  import fastjsonschema
15
16
  import requests
17
+ from bson.son import SON
16
18
  from frozendict import frozendict
17
- from linkml_runtime import linkml_model
18
- from linkml_runtime.utils.schemaview import SchemaView
19
+ from linkml_runtime import SchemaView
19
20
  from nmdc_schema.get_nmdc_view import ViewGetter
20
21
  from pymongo.database import Database as MongoDatabase
21
22
  from pymongo.errors import OperationFailure
22
- from refscan.lib.helpers import identify_references
23
+ from refscan.lib.helpers import (
24
+ identify_references,
25
+ get_collection_name_to_class_names_map,
26
+ )
23
27
  from refscan.lib.ReferenceList import ReferenceList
24
28
  from toolz import merge
25
29
 
@@ -27,48 +31,6 @@ from nmdc_runtime.api.core.util import sha256hash_from_file
27
31
  from nmdc_runtime.api.models.object import DrsObjectIn
28
32
 
29
33
 
30
- def get_names_of_classes_in_effective_range_of_slot(
31
- schema_view: SchemaView, slot_definition: linkml_model.SlotDefinition
32
- ) -> List[str]:
33
- r"""
34
- Determine the slot's "effective" range, by taking into account its `any_of` constraints (if defined).
35
-
36
- Note: The `any_of` constraints constrain the slot's "effective" range beyond that described by the
37
- induced slot definition's `range` attribute. `SchemaView` does not seem to provide the result
38
- of applying those additional constraints, so we do it manually here (if any are defined).
39
- Reference: https://github.com/orgs/linkml/discussions/2101#discussion-6625646
40
-
41
- Reference: https://linkml.io/linkml-model/latest/docs/any_of/
42
- """
43
-
44
- # Initialize the list to be empty.
45
- names_of_eligible_target_classes = []
46
-
47
- # If the `any_of` constraint is defined on this slot, use that instead of the `range`.
48
- if "any_of" in slot_definition and len(slot_definition.any_of) > 0:
49
- for slot_expression in slot_definition.any_of:
50
- # Use the slot expression's `range` to get the specified eligible class name
51
- # and the names of all classes that inherit from that eligible class.
52
- if slot_expression.range in schema_view.all_classes():
53
- own_and_descendant_class_names = schema_view.class_descendants(
54
- slot_expression.range
55
- )
56
- names_of_eligible_target_classes.extend(own_and_descendant_class_names)
57
- else:
58
- # Use the slot's `range` to get the specified eligible class name
59
- # and the names of all classes that inherit from that eligible class.
60
- if slot_definition.range in schema_view.all_classes():
61
- own_and_descendant_class_names = schema_view.class_descendants(
62
- slot_definition.range
63
- )
64
- names_of_eligible_target_classes.extend(own_and_descendant_class_names)
65
-
66
- # Remove duplicate class names.
67
- names_of_eligible_target_classes = list(set(names_of_eligible_target_classes))
68
-
69
- return names_of_eligible_target_classes
70
-
71
-
72
34
  def get_class_names_from_collection_spec(
73
35
  spec: dict, prefix: Optional[str] = None
74
36
  ) -> List[str]:
@@ -324,9 +286,9 @@ def find_one(k_v: dict, entities: Iterable[dict]):
324
286
  """Find the first entity with key-value pair k_v, if any?
325
287
 
326
288
  >>> find_one({"id": "foo"}, [{"id": "foo"}])
289
+ {'id': 'foo'}
290
+ >>> find_one({"id": "foo"}, [{"id": "bar"}]) is None
327
291
  True
328
- >>> find_one({"id": "foo"}, [{"id": "bar"}])
329
- False
330
292
  """
331
293
  if len(k_v) > 1:
332
294
  raise Exception("Supports only one key-value pair")
@@ -352,6 +314,32 @@ def nmdc_schema_view():
352
314
  return ViewGetter().get_view()
353
315
 
354
316
 
317
+ @lru_cache
318
+ def get_class_name_to_collection_names_map(
319
+ schema_view: SchemaView,
320
+ ) -> Dict[str, List[str]]:
321
+ """
322
+ Returns a mapping of class names to the names of the collections that can store instances of those classes/types,
323
+ according to the specified `SchemaView`.
324
+
325
+ Example output:
326
+ ```
327
+ {
328
+ "Study": ["study_set"],
329
+ "Biosample": ["biosample_set"],
330
+ ...
331
+ }
332
+ ```
333
+ """
334
+ class_name_to_collection_names = defaultdict(list)
335
+ for collection_name, class_names in get_collection_name_to_class_names_map(
336
+ schema_view
337
+ ).items():
338
+ for class_name in class_names:
339
+ class_name_to_collection_names[class_name].append(collection_name)
340
+ return class_name_to_collection_names
341
+
342
+
355
343
  @lru_cache
356
344
  def nmdc_database_collection_instance_class_names():
357
345
  names = []
@@ -370,7 +358,7 @@ def nmdc_database_collection_names():
370
358
  TODO: Document this function.
371
359
 
372
360
  TODO: Assuming this function was designed to return a list of names of all Database slots that represents database
373
- collections, use the function named `get_collection_names_from_schema` in `nmdc_runtime/api/db/mongo.py`
361
+ collections, import/use the function named `get_collection_names_from_schema` from `refscan.lib.helpers`
374
362
  instead, since (a) it includes documentation and (b) it performs the additional checks the lead schema
375
363
  maintainer expects (e.g. checking whether a slot is `multivalued` and `inlined_as_list`).
376
364
  """
@@ -406,6 +394,12 @@ def all_docs_have_unique_id(coll) -> bool:
406
394
 
407
395
 
408
396
  def specialize_activity_set_docs(docs):
397
+ """
398
+ TODO: Document this function.
399
+
400
+ TODO: Check whether this function is still necessary, given that the `Database` class
401
+ in `nmdc-schema` does not have a slot named `activity_set`.
402
+ """
409
403
  validation_errors = {}
410
404
  type_collections = get_type_collections()
411
405
  if "activity_set" in docs:
@@ -489,6 +483,49 @@ def populated_schema_collection_names_with_id_field(mdb: MongoDatabase) -> List[
489
483
  return [n for n in collection_names if mdb[n].find_one({"id": {"$exists": True}})]
490
484
 
491
485
 
486
+ def does_collection_have_unique_index_on_id_field(
487
+ collection_name: str, db: MongoDatabase
488
+ ) -> bool:
489
+ """Check whether the specified MongoDB collection has a unique index on its `id` field (not `_id`).
490
+
491
+ Note: If the specified MongoDB collection either does not exist or is a _view_ instead of a collection,
492
+ this function will return `False`.
493
+
494
+ References:
495
+ - https://pymongo.readthedocs.io/en/stable/api/pymongo/collection.html#pymongo.collection.Collection.list_indexes
496
+ - https://pymongo.readthedocs.io/en/stable/api/pymongo/collection.html#pymongo.collection.Collection.index_information
497
+ """
498
+ # Check whether the specified collection actually exists in the database; and, if it does,
499
+ # whether it is really a _collection_ (as opposed to being a _view_). If it doesn't exist,
500
+ # or it is a view, return `False` right away.
501
+ collection_infos_cursor = db.list_collections(filter={"name": collection_name})
502
+ collection_infos = list(collection_infos_cursor)
503
+ if len(collection_infos) == 0:
504
+ return False
505
+ collection_info = collection_infos[0]
506
+ if collection_info["type"] != "collection":
507
+ return False
508
+
509
+ # Now that we know we're dealing with a collection, get information about each of its indexes.
510
+ collection = db.get_collection(collection_name)
511
+ for index_information in collection.list_indexes():
512
+ # Get the "field_name-direction" pairs that make up this index.
513
+ field_name_and_direction_pairs: SON = index_information["key"]
514
+
515
+ # If this index involves a number of fields other than one, skip it.
516
+ # We're only interested in indexes that involve the `id` field by itself.
517
+ if len(field_name_and_direction_pairs.keys()) != 1:
518
+ continue
519
+
520
+ # Check whether the field this index involves is the `id` field,
521
+ # and whether this index is `unique`.
522
+ field_name = list(field_name_and_direction_pairs.keys())[0]
523
+ if field_name == "id" and index_information.get("unique", False):
524
+ return True
525
+
526
+ return False
527
+
528
+
492
529
  def ensure_unique_id_indexes(mdb: MongoDatabase):
493
530
  """Ensure that any collections with an "id" field have an index on "id"."""
494
531
 
@@ -503,6 +540,11 @@ def ensure_unique_id_indexes(mdb: MongoDatabase):
503
540
  if collection_name.startswith("system."): # reserved by mongodb
504
541
  continue
505
542
 
543
+ # If the collection already has a unique index on `id`, there's no need
544
+ # to check anything else about the collection.
545
+ if does_collection_have_unique_index_on_id_field(collection_name, mdb):
546
+ continue
547
+
506
548
  if (
507
549
  collection_name in schema_collection_names_with_id_field()
508
550
  or all_docs_have_unique_id(mdb[collection_name])
@@ -0,0 +1,46 @@
1
+ Metadata-Version: 2.4
2
+ Name: nmdc-runtime
3
+ Version: 2.11.0
4
+ Summary: A runtime system for NMDC data management and orchestration
5
+ Project-URL: Changelog, https://github.com/microbiomedata/nmdc-runtime/releases
6
+ Project-URL: Documentation, https://docs.microbiomedata.org/runtime
7
+ Project-URL: Issues, https://github.com/microbiomedata/nmdc-runtime/issues
8
+ Project-URL: Repository, https://github.com/microbiomedata/nmdc-runtime
9
+ License-File: LICENSE
10
+ Requires-Python: >=3.10
11
+ Requires-Dist: base32-lib
12
+ Requires-Dist: boto3
13
+ Requires-Dist: click
14
+ Requires-Dist: dagit
15
+ Requires-Dist: dagster
16
+ Requires-Dist: dagster-graphql
17
+ Requires-Dist: dagster-postgres
18
+ Requires-Dist: fastapi>=0.115.0
19
+ Requires-Dist: fastjsonschema
20
+ Requires-Dist: frozendict
21
+ Requires-Dist: git-root
22
+ Requires-Dist: jq
23
+ Requires-Dist: jsonasobj2
24
+ Requires-Dist: linkml
25
+ Requires-Dist: linkml-runtime
26
+ Requires-Dist: lxml
27
+ Requires-Dist: nmdc-schema==11.11.1
28
+ Requires-Dist: ontology-loader==0.2.2
29
+ Requires-Dist: pandas
30
+ Requires-Dist: passlib[bcrypt]
31
+ Requires-Dist: pydantic[email]>=1.10.0
32
+ Requires-Dist: pyinstrument
33
+ Requires-Dist: pymongo
34
+ Requires-Dist: python-dotenv
35
+ Requires-Dist: python-jose[cryptography]
36
+ Requires-Dist: python-multipart>=0.0.18
37
+ Requires-Dist: pyyaml
38
+ Requires-Dist: refscan==0.3.2
39
+ Requires-Dist: requests
40
+ Requires-Dist: requests-cache
41
+ Requires-Dist: scalar-fastapi<2.0.0,>=1.4.1
42
+ Requires-Dist: tenacity
43
+ Requires-Dist: toolz
44
+ Requires-Dist: tqdm
45
+ Requires-Dist: unidecode
46
+ Requires-Dist: uvicorn[standard]
@@ -0,0 +1,128 @@
1
+ nmdc_runtime/Dockerfile,sha256=3CyLW_4PRP-8cpwJHAiP4u_n736de-TJmi0dcVXbP1s,9257
2
+ nmdc_runtime/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
+ nmdc_runtime/config.py,sha256=fVxcqdXv13Fa9CSRPnFIsfmvmlos8o4SFUZcmsXfX_8,2020
4
+ nmdc_runtime/main.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
+ nmdc_runtime/mongo_util.py,sha256=L6UxK_6f0wQw2NTKCUVKCp-QLhBudQczDLUdF5odbP8,2943
6
+ nmdc_runtime/util.py,sha256=jHrpk79XHWgarOEzSP9nAsenu5zTV2PrkdIslDeQf8I,21071
7
+ nmdc_runtime/api/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
8
+ nmdc_runtime/api/analytics.py,sha256=Vp-BYQZ_sqR282FLLkGUoxlieSqyXxU0DmMvjDzMVsI,3723
9
+ nmdc_runtime/api/entrypoint.sh,sha256=y3lZU2xPnZ3cAVK7tn0Nw-qVGElryt9fzj1IaZ5kkGw,209
10
+ nmdc_runtime/api/main.py,sha256=WnpM-abWDLbxj5mT116UO_45xiO7ec0LQ2ZhGdZhE78,16649
11
+ nmdc_runtime/api/middleware.py,sha256=GUVN26Ym9H87gaxrBs0NAMpOoA7qQfv-7UnIJOkcQkI,1703
12
+ nmdc_runtime/api/openapi.py,sha256=8E522L6zvhtfM_-eyTNE_Z7EwVvLQh54QUhvvSO5bj0,10159
13
+ nmdc_runtime/api/boot/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
14
+ nmdc_runtime/api/boot/capabilities.py,sha256=9Cp_yULUeEXN7Nz-WC5XJXTaB7fhOWOCGp8mx050qgg,291
15
+ nmdc_runtime/api/boot/object_types.py,sha256=JL6OZw34lKkbKJJXDIiswfLmn1tkOng4ZKF6ypqWKhs,4382
16
+ nmdc_runtime/api/boot/triggers.py,sha256=fLM588CBYft_no1ENN13XSO6Cj4DB90ZKJl-1UgfsYw,2723
17
+ nmdc_runtime/api/boot/workflows.py,sha256=UpOAMjVKagat-PCKPx7HuriLTnCbhj0EVgpk7UuLpQQ,3826
18
+ nmdc_runtime/api/core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
19
+ nmdc_runtime/api/core/auth.py,sha256=c38EjN3Ckd3uuR70qqTiAKF3EedZCihoVvTKBmBSRMQ,7453
20
+ nmdc_runtime/api/core/idgen.py,sha256=ru9nAczRAEp1Koq8yXLCMdkN39dNvfTrIwWwVI2SeWo,8101
21
+ nmdc_runtime/api/core/metadata.py,sha256=AMX-EWfyOU_xobIlDf98PTQLuNCbZuyCPCIELKAoMIk,27943
22
+ nmdc_runtime/api/core/util.py,sha256=OGE9kCui-wEfkfdUeUOBNeqmHJ5fNpJepBo0ivYkMnE,3232
23
+ nmdc_runtime/api/db/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
24
+ nmdc_runtime/api/db/mongo.py,sha256=9TfgCTvAmaKp6C7a9AkUTqkYTMYYzyM4na2Ying2ip0,19988
25
+ nmdc_runtime/api/db/s3.py,sha256=tRFEjjVXHMiUdZtRiq1ImvLza2s86TkgubDw3kchDOA,1046
26
+ nmdc_runtime/api/endpoints/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
27
+ nmdc_runtime/api/endpoints/capabilities.py,sha256=AkSh8wcsVSOkkjH0kzcM2TcO2o8AuKyXGt1km_VgwVs,717
28
+ nmdc_runtime/api/endpoints/find.py,sha256=AimO1vgq2DlO17yrPa1QCkEzZDbxyIBFxd09cTGbcOE,27063
29
+ nmdc_runtime/api/endpoints/jobs.py,sha256=waQk3A7gGIqcr2GNNX988Bxbvx5bxq-kGKmWXeNBrpY,5010
30
+ nmdc_runtime/api/endpoints/metadata.py,sha256=Msj7k5DxXUzXCZWcvy91T7AIFj1chhn_53Dsc44_qmc,9886
31
+ nmdc_runtime/api/endpoints/nmdcschema.py,sha256=-bP9vL_CglQXwSC_5mO8zf4AOlehM_8mmn0ksEFZkOk,20515
32
+ nmdc_runtime/api/endpoints/object_types.py,sha256=dTbl3A9j9lyk186arA7cszTEKOY7vXWJO_aKYfFAV8s,1179
33
+ nmdc_runtime/api/endpoints/objects.py,sha256=J9cJENV8hfHjGAszft2j15OqAxDmrKhtsfJmEYHdpdE,10380
34
+ nmdc_runtime/api/endpoints/operations.py,sha256=iWDGoxa2w5k9tHaW0V_o6IjZZipUJqyY3OiCiYCBluA,2542
35
+ nmdc_runtime/api/endpoints/queries.py,sha256=2e3XiIH1dNULF42g3JHw-s0heRIjpe2rsBuIb4XhIb0,29716
36
+ nmdc_runtime/api/endpoints/runs.py,sha256=PWoEKCFQhWgpWklmRUjTc0UZCvDAa1i59gnPhAcZirA,3326
37
+ nmdc_runtime/api/endpoints/search.py,sha256=_h30mu8_Xndjggg3IllMDn5h8k92BX0ubxqRO85R0Ss,1187
38
+ nmdc_runtime/api/endpoints/sites.py,sha256=Cju6x1Trb25cZMc7BjumupVbpJleDf8Y3bVeuuxR4NE,6565
39
+ nmdc_runtime/api/endpoints/triggers.py,sha256=1DG2oEOV7zu5bT2qoeHrLNajY6K6sEGi7O7po3Bcmbk,673
40
+ nmdc_runtime/api/endpoints/users.py,sha256=syu_Tz05k-OAsDMhe125ofqeiCkmDMjdbRlfvRZ5_rI,7816
41
+ nmdc_runtime/api/endpoints/util.py,sha256=gNRIFNxBBDxY-qMBnr8F8qjhkNYxJTy_IN0JQkU5wp4,28393
42
+ nmdc_runtime/api/endpoints/workflows.py,sha256=HWTnt-yrHp2DcrQT8BS_-SRQWNibkKNPVOpwqjS9QCA,14383
43
+ nmdc_runtime/api/endpoints/lib/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
44
+ nmdc_runtime/api/endpoints/lib/helpers.py,sha256=E6pH0NtzKiSGBgIfoeukH5qeHKtxjLtCvw4F8LOacTQ,13874
45
+ nmdc_runtime/api/endpoints/lib/linked_instances.py,sha256=eGBStkzI4bNHqFi1wILQ0JtfolC3h1dFWd8zGDeXdXY,7226
46
+ nmdc_runtime/api/endpoints/lib/path_segments.py,sha256=4nIy_KrYvTc80Np3ELnT94VCk2QfR-2055fMlcbBSPw,5724
47
+ nmdc_runtime/api/models/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
48
+ nmdc_runtime/api/models/capability.py,sha256=4__rqgLS4MCMjbaCM3e_ncR9KW001Klm34p2t_bp65k,262
49
+ nmdc_runtime/api/models/id.py,sha256=D8kDS-f3-OIxaNKrkhrdvyxu90ac4SDeFpVHboycDac,2724
50
+ nmdc_runtime/api/models/job.py,sha256=GrmGDlw7qJS8FCz4Z5PvC2U5LcwC_DZXvTYAmEOSI4g,755
51
+ nmdc_runtime/api/models/metadata.py,sha256=mVCC0KODtKzNEYABk70jaKVoOTyZP87eCtzf96lgysw,196
52
+ nmdc_runtime/api/models/minter.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
53
+ nmdc_runtime/api/models/nmdc_schema.py,sha256=C-Jb_eHr4dSVoYP-r7ldBUW-JHhCqSMtxSMT9HWKZ70,5768
54
+ nmdc_runtime/api/models/object.py,sha256=A-U5RkWfmEsb50x9ai5xdpHo9xy-O9mZj2gKCoBR87E,5004
55
+ nmdc_runtime/api/models/object_type.py,sha256=2Ejn5iCbqwqVEaOcYo4mvUJgBTDMhlmw8cLD92bWwSE,399
56
+ nmdc_runtime/api/models/operation.py,sha256=Nb_Ys8P_vdxL-5fcKTeNTmB9CongxK3-JWs0vhgkNq8,1606
57
+ nmdc_runtime/api/models/query.py,sha256=899fPzA55xyskflLXQKlIADQATsnpl8-Pu5rhrE7MvA,6739
58
+ nmdc_runtime/api/models/query_continuation.py,sha256=bWVX7ijk34kOCedxAWFGgSTNgpy98yp0IZni31oD3-Y,4150
59
+ nmdc_runtime/api/models/run.py,sha256=OhWBc6lQeEM-GSgUpvJCE2xbZQzv8kdPsEkWlL0xolM,4406
60
+ nmdc_runtime/api/models/site.py,sha256=KLLgln2KJrinUDp6ixxci1JFmcLAL4O4vEtFTZKc82U,2310
61
+ nmdc_runtime/api/models/trigger.py,sha256=TviQMk9-2HMZgCiaXYAF0WFnjD295jxnJLJCWsmtem4,201
62
+ nmdc_runtime/api/models/user.py,sha256=R_K7f2Zaajo8-gCwKwu4Ytfg063v31Yb5xQSIH_iYxw,4083
63
+ nmdc_runtime/api/models/util.py,sha256=koEyCBqizwHr-fzjoD_OJCN0c1n5apd3bVYdU-YWRvM,11659
64
+ nmdc_runtime/api/models/workflow.py,sha256=etPFP_L9DcRoIAFwvMYzLLT2WlwRG6T68-7tzNzXnQ0,326
65
+ nmdc_runtime/api/models/lib/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
66
+ nmdc_runtime/api/models/lib/helpers.py,sha256=k6AihKIiQ0kg2kk_qY_VNWTb96LGkazuztARhgjHr8M,2410
67
+ nmdc_runtime/api/swagger_ui/swagger_ui.py,sha256=lGl4sF7MXsWbX7fiauDPKUOVSVag_WeH7ja5J_KBHg0,1887
68
+ nmdc_runtime/api/swagger_ui/assets/custom-elements.js,sha256=0bxUleZpdRbjFB0t0Tmg3-ReGKfnK6r3bUGjr7zW5UQ,23972
69
+ nmdc_runtime/api/swagger_ui/assets/script.js,sha256=tB7q6OxCLQOOd_-PMt1DjFnQgn3ticM8yemrpetZkQA,13536
70
+ nmdc_runtime/api/swagger_ui/assets/style.css,sha256=BucritiMpu_UJdgSdDBImFpQHMQ2SaZzUd179gZ2Zx0,4565
71
+ nmdc_runtime/minter/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
72
+ nmdc_runtime/minter/bootstrap.py,sha256=5Ej6pJVBRryRIi0ZwEloY78Zky7iE2okF6tPwRI2axM,822
73
+ nmdc_runtime/minter/config.py,sha256=-E1kQXTDraabrN4CENuVCHcNJafjVdiHWeUrucxBzMQ,2741
74
+ nmdc_runtime/minter/adapters/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
75
+ nmdc_runtime/minter/adapters/repository.py,sha256=CVVRdGclIDBgbqaOSmSl7OkOSE43kt6zJpE-etXIkOs,9267
76
+ nmdc_runtime/minter/domain/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
77
+ nmdc_runtime/minter/domain/model.py,sha256=k1n3O3GYfhmFdjU_oHadVTeUIxORQf-VPW4Xy6S5SCQ,3599
78
+ nmdc_runtime/minter/entrypoints/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
79
+ nmdc_runtime/minter/entrypoints/fastapi_app.py,sha256=I_lgExs6g1MRpMQdpedrnYdA1L7r_TBi4RiiD8ogrkM,4015
80
+ nmdc_runtime/site/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
81
+ nmdc_runtime/site/dagster.yaml,sha256=VCFx2naLjaNzP8AYr5uvzxRIf4fC0mHm7cctcYsVrNA,1204
82
+ nmdc_runtime/site/entrypoint-daemon.sh,sha256=kTc9dQqzR0eQ9TBZcOeeYRXBOKRe05A1INRFes-z3hw,513
83
+ nmdc_runtime/site/entrypoint-dagit-readonly.sh,sha256=ZY-K3l6apK8jA4mjcxePsjWb4_rh-WKz3CHmvvK_zj0,549
84
+ nmdc_runtime/site/entrypoint-dagit.sh,sha256=TWEIAyKyCEMHX5XnbGLO0xdhYNgeXsxgs1GFnr2Avms,537
85
+ nmdc_runtime/site/graphs.py,sha256=KeC6SKFNUW6SGubruFRrZsfBRN6tUfc3tp6tEst8bMU,17910
86
+ nmdc_runtime/site/ops.py,sha256=RainLCYEvgglHqgwJWdHu4C15W3DxKOx428vxZSIK_Q,62974
87
+ nmdc_runtime/site/repository.py,sha256=Kcdt293K1irWcmw7R9L-5sTEBhdoaIdgdM0mgFNrMMc,44117
88
+ nmdc_runtime/site/resources.py,sha256=474u5BvwKubW-oMlQNTXQ9nJTh8dU-Sr_L9k7VhYt_s,20756
89
+ nmdc_runtime/site/util.py,sha256=4h0X_fhjf3HdX6XDR8GvHgkrpxQY4OnZVtaOeXJVxJQ,1935
90
+ nmdc_runtime/site/workspace.yaml,sha256=RCw5i-v0T9MWuEZE-y1vEIJz6x2bpm1fyxheLxLEVLk,431
91
+ nmdc_runtime/site/backup/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
92
+ nmdc_runtime/site/backup/nmdcdb_mongodump.py,sha256=My2ORKVIk_Z9wzfnIuamDe3_hv4viid9ToSJDC5J4mY,2689
93
+ nmdc_runtime/site/backup/nmdcdb_mongoexport.py,sha256=y1x3B4-qxF5_itXOKYaix99OvDhW_PYxhLoLc4Y5E1M,4028
94
+ nmdc_runtime/site/backup/nmdcdb_mongoimport.py,sha256=k6w5yscMNYoMBVkaAA9soWS0Dj2CB0FRBSFlifRO3Ro,1739
95
+ nmdc_runtime/site/changesheets/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
96
+ nmdc_runtime/site/changesheets/base.py,sha256=lZT6WCsEBl-FsTr7Ki8_ploT93uMiVyIWWKM36aOrRk,3171
97
+ nmdc_runtime/site/changesheets/data/OmicsProcessing-to-catted-Biosamples.tsv,sha256=lfAaAhnEOBbXoGmGhVoxbbJRnUOLDtWrF6ycAOtsJFg,128790
98
+ nmdc_runtime/site/changesheets/scripts/missing_neon_soils_ecosystem_data.py,sha256=w7025ohUmoWxYHAl4zTFaV_Ig-CWkeeiZGlEs2J57mc,11628
99
+ nmdc_runtime/site/changesheets/scripts/neon_soils_add_ncbi_ids.py,sha256=OfaVAlhtd7DbH3Y5jHMGnDgOobWel4FnL3tP5BGJqaA,7969
100
+ nmdc_runtime/site/export/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
101
+ nmdc_runtime/site/export/ncbi_xml.py,sha256=kDRIv_0eeXfXlpTmK6PbvQYHd1bS69fa3RfE5XpLeIM,54933
102
+ nmdc_runtime/site/export/ncbi_xml_utils.py,sha256=HkE3Iufoqe-9rc6gOVVaqxpz7j98O5idL027w624UwA,15423
103
+ nmdc_runtime/site/export/study_metadata.py,sha256=yR5pXL6JG8d7cAtqcF-60Hp7bLD3dJ0Rut4AtYc0tXA,4844
104
+ nmdc_runtime/site/normalization/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
105
+ nmdc_runtime/site/normalization/gold.py,sha256=iISDD4qs4d6uLhv631WYNeQVOzY5DO201ZpPtxHdkVk,1311
106
+ nmdc_runtime/site/repair/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
107
+ nmdc_runtime/site/repair/database_updater.py,sha256=a6POYZcLEl0JvnuWxPjaOJtwZjkJhhvvUg1ABhnBiP8,21268
108
+ nmdc_runtime/site/translation/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
109
+ nmdc_runtime/site/translation/gold_translator.py,sha256=4AFgbJtHaVwme3a57Y6Foi-uzI8oBHUlOt3Ns7_a5_o,32879
110
+ nmdc_runtime/site/translation/neon_benthic_translator.py,sha256=CMoC56ymA0DKPkzqdMR4m5yYV6EcyH3tOvOiA3P6goE,23762
111
+ nmdc_runtime/site/translation/neon_soil_translator.py,sha256=MMntFXwK62PdPNGpurTq5L3-pct7xAmUymRE2QqMPso,38572
112
+ nmdc_runtime/site/translation/neon_surface_water_translator.py,sha256=_-KDZzC30dQ1y57lXEKWXE6ZfGozNHxGFvbGaj4f0Lg,30536
113
+ nmdc_runtime/site/translation/neon_utils.py,sha256=d00o7duKKugpLHmsEifNbp4WjeC4GOqcgw0b5qlCg4I,5549
114
+ nmdc_runtime/site/translation/submission_portal_translator.py,sha256=351ZfV-SleRAlKEufntP68xYl_oE4b-SeFnHgMpoB1g,45284
115
+ nmdc_runtime/site/translation/translator.py,sha256=kVmDIVfxQ0ry6obAc_SyvlEcPwPCupYeKenRylZWWbI,3643
116
+ nmdc_runtime/site/validation/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
117
+ nmdc_runtime/site/validation/emsl.py,sha256=OG20mv_3E2rkQqTQtYO0_SVRqFb-Z_zKCiAVbty6Wl0,671
118
+ nmdc_runtime/site/validation/gold.py,sha256=Z5ZzYdjERbrJ2Tu06d0TDTBSfwaFdL1Z23Rl-YkZ2Ow,803
119
+ nmdc_runtime/site/validation/util.py,sha256=Fz3c7dOEKOiYXssitYb50uUI1yRx3wJzFBl0s95Za7s,3632
120
+ nmdc_runtime/static/NMDC_logo.svg,sha256=-13FrhQMWOg7FMprd3p6dwSOEf8xWkrHJB_P-nxGvLw,40570
121
+ nmdc_runtime/static/ORCID-iD_icon_vector.svg,sha256=JOKAW7lAn7Giws6aS_jBQGYG4DoPUBQ5S5mgmCSwmcA,973
122
+ nmdc_runtime/static/README.md,sha256=g0fitEFvZfBcSWzgjOxzDdfouBlq95xFKpAag0VPzL4,397
123
+ nmdc_runtime/static/favicon.ico,sha256=FsOefOmgCU9fp2f1FxKimZ8zHg7mBYj_Cv70S5VIcuI,15086
124
+ nmdc_runtime-2.11.0.dist-info/METADATA,sha256=_lp2sVUd9rtPOgYgMSkF6TOgmIDSV9pT-mhr8hGtjTg,1470
125
+ nmdc_runtime-2.11.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
126
+ nmdc_runtime-2.11.0.dist-info/entry_points.txt,sha256=JxdvOnvxHK_8046cwlvE30s_fV0-k-eTpQtkKYA69nQ,224
127
+ nmdc_runtime-2.11.0.dist-info/licenses/LICENSE,sha256=VWiv65r7gHGjgtr3jMJYVmQny5GRpQ6H-W9sScb1x70,2408
128
+ nmdc_runtime-2.11.0.dist-info/RECORD,,
@@ -1,5 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (80.9.0)
2
+ Generator: hatchling 1.27.0
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
-
@@ -1,14 +0,0 @@
1
- """Containers module."""
2
-
3
- from dependency_injector import containers, providers
4
-
5
- from nmdc_runtime.domain.users.userService import UserService
6
- from nmdc_runtime.infrastructure.database.impl.mongo.models.user import (
7
- UserQueries,
8
- )
9
-
10
-
11
- class Container(containers.DeclarativeContainer):
12
- user_queries = providers.Singleton(UserQueries)
13
-
14
- user_service = providers.Factory(UserService, user_queries=user_queries)
@@ -1,15 +0,0 @@
1
- from contextlib import contextmanager, AbstractContextManager
2
- from typing import Callable
3
- import logging
4
-
5
- from motor import motor_asyncio
6
-
7
-
8
- class Database:
9
- def __init__(self, db_url: str) -> None:
10
- self._client = motor_asyncio.AsyncIOMotorClient(db_url)
11
- self._db = self._client["database"]
12
-
13
- @contextmanager
14
- def session(self):
15
- return self._db
@@ -1,23 +0,0 @@
1
- from .base import (
2
- CustomException,
3
- BadRequestException,
4
- NotFoundException,
5
- ForbiddenException,
6
- UnprocessableEntity,
7
- DuplicateValueException,
8
- UnauthorizedException,
9
- )
10
- from .token import DecodeTokenException, ExpiredTokenException
11
-
12
-
13
- __all__ = [
14
- "CustomException",
15
- "BadRequestException",
16
- "NotFoundException",
17
- "ForbiddenException",
18
- "UnprocessableEntity",
19
- "DuplicateValueException",
20
- "UnauthorizedException",
21
- "DecodeTokenException",
22
- "ExpiredTokenException",
23
- ]
@@ -1,47 +0,0 @@
1
- from http import HTTPStatus
2
-
3
-
4
- class CustomException(Exception):
5
- code = HTTPStatus.BAD_GATEWAY
6
- error_code = HTTPStatus.BAD_GATEWAY
7
- message = HTTPStatus.BAD_GATEWAY.description
8
-
9
- def __init__(self, message=None):
10
- if message:
11
- self.message = message
12
-
13
-
14
- class BadRequestException(CustomException):
15
- code = HTTPStatus.BAD_REQUEST
16
- error_code = HTTPStatus.BAD_REQUEST
17
- message = HTTPStatus.BAD_REQUEST.description
18
-
19
-
20
- class NotFoundException(CustomException):
21
- code = HTTPStatus.NOT_FOUND
22
- error_code = HTTPStatus.NOT_FOUND
23
- message = HTTPStatus.NOT_FOUND.description
24
-
25
-
26
- class ForbiddenException(CustomException):
27
- code = HTTPStatus.FORBIDDEN
28
- error_code = HTTPStatus.FORBIDDEN
29
- message = HTTPStatus.FORBIDDEN.description
30
-
31
-
32
- class UnauthorizedException(CustomException):
33
- code = HTTPStatus.UNAUTHORIZED
34
- error_code = HTTPStatus.UNAUTHORIZED
35
- message = HTTPStatus.UNAUTHORIZED.description
36
-
37
-
38
- class UnprocessableEntity(CustomException):
39
- code = HTTPStatus.UNPROCESSABLE_ENTITY
40
- error_code = HTTPStatus.UNPROCESSABLE_ENTITY
41
- message = HTTPStatus.UNPROCESSABLE_ENTITY.description
42
-
43
-
44
- class DuplicateValueException(CustomException):
45
- code = HTTPStatus.UNPROCESSABLE_ENTITY
46
- error_code = HTTPStatus.UNPROCESSABLE_ENTITY
47
- message = HTTPStatus.UNPROCESSABLE_ENTITY.description
@@ -1,13 +0,0 @@
1
- from nmdc_runtime.core.exceptions import CustomException
2
-
3
-
4
- class DecodeTokenException(CustomException):
5
- code = 400
6
- error_code = 10000
7
- message = "token decode error"
8
-
9
-
10
- class ExpiredTokenException(CustomException):
11
- code = 400
12
- error_code = 10001
13
- message = "expired token"
@@ -1,18 +0,0 @@
1
- from __future__ import annotations
2
- from abc import ABC
3
-
4
- from abc import abstractmethod
5
-
6
- from nmdc_runtime.domain.users.userSchema import UserAuth, UserUpdate, UserOut
7
-
8
-
9
- class IUserQueries(ABC):
10
- @abstractmethod
11
- async def create(self, user: UserAuth) -> UserOut:
12
- """Create new user"""
13
- raise NotImplementedError
14
-
15
- @abstractmethod
16
- async def update(self, user: UserUpdate) -> UserOut:
17
- """Update user data"""
18
- raise NotImplementedError
@@ -1,37 +0,0 @@
1
- from typing import Optional, List
2
-
3
-
4
- from pydantic import BaseModel, EmailStr
5
-
6
-
7
- class UserBase(BaseModel):
8
- username: Optional[str] = None
9
- email: Optional[str] = None
10
- full_name: Optional[str] = None
11
- site_admin: Optional[List[str]] = []
12
- disabled: Optional[bool] = False
13
-
14
-
15
- class UserAuth(UserBase):
16
- """User register and login auth"""
17
-
18
- username: str
19
- password: str
20
-
21
-
22
- # Properties to receive via API on update
23
- class UserUpdate(UserBase):
24
- """Updatable user fields"""
25
-
26
- email: Optional[EmailStr] = None
27
-
28
- # User information
29
- full_name: Optional[str] = None
30
- password: Optional[str] = None
31
-
32
-
33
- class UserOut(UserUpdate):
34
- """User fields pushed to the client"""
35
-
36
- email: EmailStr
37
- disabled: Optional[bool] = False
@@ -1,14 +0,0 @@
1
- from typing import Any
2
-
3
- from nmdc_runtime.domain.users.userSchema import UserAuth, UserUpdate, UserOut
4
-
5
-
6
- class UserService:
7
- def __init__(self, user_queries: Any) -> None:
8
- self.__user_queries = user_queries
9
-
10
- async def create_user(self, user: UserAuth) -> UserOut:
11
- return await self.__user_queries.create(user)
12
-
13
- async def update_user(self, username: str, new_user: UserUpdate) -> UserOut:
14
- pass
@@ -1,3 +0,0 @@
1
- """
2
- Database initialization
3
- """
@@ -1,10 +0,0 @@
1
- from __future__ import annotations
2
-
3
- from abc import abstractmethod
4
- from typing import List
5
-
6
- from nmdc_runtime.domain.users.userSchema import (
7
- UserAuth,
8
- UserUpdate,
9
- UserOut,
10
- )
@@ -1 +0,0 @@
1
-
@@ -1,41 +0,0 @@
1
- ## author: Bill Duncan
2
- ## summary: Contains methods for extracting data for the NMDC ETL pipeline.
3
-
4
- ## system level modules
5
- import pandas as pds
6
- import jq
7
- import jsonasobj
8
- import json
9
- import zipfile
10
- import yaml
11
- from yaml import CLoader as Loader, CDumper as Dumper
12
- from dotted_dict import DottedDict
13
- from collections import namedtuple
14
-
15
-
16
- def extract_table(merged_df, table_name):
17
- df = unpivot_dataframe(merged_df[merged_df.nmdc_data_source == table_name])
18
- return df
19
-
20
-
21
- def unpivot_dataframe(
22
- df,
23
- index="nmdc_record_id",
24
- columns="attribute",
25
- value="value",
26
- splice=["nmdc_record_id", "attribute", "value"],
27
- ):
28
- ## reshape eav structure to row-column structure
29
- ## see: https://www.journaldev.com/33398/pandas-melt-unmelt-pivot-function
30
- if len(splice) > 0:
31
- df = df[splice].pivot(index=index, columns=columns)
32
- else:
33
- df = df.pivot(index=index, columns=columns)
34
-
35
- if len(df) > 0:
36
- df = df[value].reset_index() # drop value hierarchical index
37
- if len(df) > 0:
38
- df = df.where(pds.notnull(df), None) # replace an NaN values with None
39
- df.columns.name = None # remove column name attribute
40
-
41
- return df