dcicutils 8.7.0.1b24__py3-none-any.whl → 8.7.0.1b26__py3-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
dcicutils/portal_utils.py CHANGED
@@ -69,8 +69,8 @@ class Portal:
69
69
  self._keys_file = portal._keys_file
70
70
  self._env = portal._env
71
71
  self._server = portal._server
72
- self._app = portal._app
73
72
  self._vapp = portal._vapp
73
+ self._app = portal._app
74
74
 
75
75
  def init_from_vapp(vapp: Union[TestApp, VirtualApp, PyramidRouter], unspecified: Optional[list] = []) -> None:
76
76
  init(unspecified=unspecified)
@@ -145,9 +145,9 @@ class Portal:
145
145
  server = server[:-1]
146
146
  return prefix + server if server else None
147
147
 
148
- if app and not (app := Portal._valid_app(app)):
148
+ if (valid_app := app) and not (valid_app := Portal._valid_app(app)):
149
149
  raise Exception(f"Portal init error; invalid app: {app}")
150
- self._app = app
150
+ self._app = valid_app
151
151
  if isinstance(arg, Portal):
152
152
  init_from_portal(arg, unspecified=[env, server, app])
153
153
  elif isinstance(arg, (TestApp, VirtualApp, PyramidRouter)):
@@ -298,6 +298,8 @@ class Portal:
298
298
  """
299
299
  if isinstance(schema_name_or_object, dict):
300
300
  return self.isinstance_schema(schema_name_or_object, target_schema_name)
301
+ elif not isinstance(schema_name_or_object, str) or not schema_name_or_object:
302
+ return False
301
303
  schema_name = self.schema_name(schema_name_or_object).lower()
302
304
  target_schema_name = self.schema_name(target_schema_name).lower()
303
305
  if schema_name == target_schema_name:
@@ -341,8 +343,8 @@ class Portal:
341
343
  """
342
344
  Returns the "super type map" for all of the known schemas (via /profiles).
343
345
  This is a dictionary with property names which are all known schema type names which
344
- have (one or more) sub-types, and the value each such property name is an array of
345
- all of those sub-types (direct and all descendents), in breadth first order.
346
+ have (one or more) sub-types, and the value of each such property name is an array
347
+ of all of those sub-types (direct and all descendents), in breadth first order.
346
348
  """
347
349
  def list_breadth_first(super_type_map: dict, super_type_name: str) -> dict:
348
350
  result = []
@@ -602,12 +602,22 @@ class Portal(PortalBase):
602
602
  resolved = []
603
603
  if self._ref_exists_single(type_name, value):
604
604
  resolved.append(type_name)
605
+ # TODO: Added this return on 2024-01-14 (dmichaels).
606
+ # Why did I orginally check for multiple existing values?
607
+ # Why not just return right away if I find that the ref exists?
608
+ # Getting multiple values because, for example, we find
609
+ # both this /Sample/UW_CELL-CULTURE-SAMPLE_COLO-829BL_HI-C_1
610
+ # and /CellSample/UW_CELL-CULTURE-SAMPLE_COLO-829BL_HI-C_1
611
+ # Why does that matter at all? Same thing.
612
+ return resolved
605
613
  # Check for the given ref in all sub-types of the given type.
606
614
  if (schemas_super_type_map := self.get_schemas_super_type_map()):
607
615
  if (sub_type_names := schemas_super_type_map.get(type_name)):
608
616
  for sub_type_name in sub_type_names:
609
617
  if self._ref_exists_single(sub_type_name, value):
610
618
  resolved.append(type_name)
619
+ # TODO: Added this return on 2024-01-14 (dmichaels). See above TODO.
620
+ return resolved
611
621
  return resolved
612
622
 
613
623
  def _ref_exists_single(self, type_name: str, value: str) -> bool:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: dcicutils
3
- Version: 8.7.0.1b24
3
+ Version: 8.7.0.1b26
4
4
  Summary: Utility package for interacting with the 4DN Data Portal and other 4DN resources
5
5
  Home-page: https://github.com/4dn-dcic/utils
6
6
  License: MIT
@@ -43,7 +43,7 @@ dcicutils/log_utils.py,sha256=7pWMc6vyrorUZQf-V-M3YC6zrPgNhuV_fzm9xqTPph0,10883
43
43
  dcicutils/misc_utils.py,sha256=bMRWWxdbhuF3PKdCZEH-H4U1ecgT3Nag3EL92D9XGoY,100973
44
44
  dcicutils/obfuscation_utils.py,sha256=fo2jOmDRC6xWpYX49u80bVNisqRRoPskFNX3ymFAmjw,5963
45
45
  dcicutils/opensearch_utils.py,sha256=V2exmFYW8Xl2_pGFixF4I2Cc549Opwe4PhFi5twC0M8,1017
46
- dcicutils/portal_utils.py,sha256=uqT_e3dhBFOKdKLEMCsJg7yIyURQ3Y68UJsglUbmY4o,25723
46
+ dcicutils/portal_utils.py,sha256=sO5S8a2g-fIwC_Spdy7aBpmDjVbijCrtU-mpd8YrZog,25864
47
47
  dcicutils/project_utils.py,sha256=qPdCaFmWUVBJw4rw342iUytwdQC0P-XKpK4mhyIulMM,31250
48
48
  dcicutils/qa_checkers.py,sha256=cdXjeL0jCDFDLT8VR8Px78aS10hwNISOO5G_Zv2TZ6M,20534
49
49
  dcicutils/qa_utils.py,sha256=TT0SiJWiuxYvbsIyhK9VO4uV_suxhB6CpuC4qPacCzQ,160208
@@ -57,15 +57,15 @@ dcicutils/secrets_utils.py,sha256=8dppXAsiHhJzI6NmOcvJV5ldvKkQZzh3Fl-cb8Wm7MI,19
57
57
  dcicutils/sheet_utils.py,sha256=VlmzteONW5VF_Q4vo0yA5vesz1ViUah1MZ_yA1rwZ0M,33629
58
58
  dcicutils/snapshot_utils.py,sha256=ymP7PXH6-yEiXAt75w0ldQFciGNqWBClNxC5gfX2FnY,22961
59
59
  dcicutils/ssl_certificate_utils.py,sha256=F0ifz_wnRRN9dfrfsz7aCp4UDLgHEY8LaK7PjnNvrAQ,9707
60
- dcicutils/structured_data.py,sha256=JIEriP5MI1UjanDwJkaZRyW1h2V1FGMwet0BOIvFMVU,32943
60
+ dcicutils/structured_data.py,sha256=-QcaVVbta9t5hIXVO0yKMDs8jQyrpvuEET0WFFkNFSM,33582
61
61
  dcicutils/task_utils.py,sha256=MF8ujmTD6-O2AC2gRGPHyGdUrVKgtr8epT5XU8WtNjk,8082
62
62
  dcicutils/tmpfile_utils.py,sha256=n95XF8dZVbQRSXBZTGToXXfSs3JUVRyN6c3ZZ0nhAWI,1403
63
63
  dcicutils/trace_utils.py,sha256=g8kwV4ebEy5kXW6oOrEAUsurBcCROvwtZqz9fczsGRE,1769
64
64
  dcicutils/validation_utils.py,sha256=cMZIU2cY98FYtzK52z5WUYck7urH6JcqOuz9jkXpqzg,14797
65
65
  dcicutils/variant_utils.py,sha256=2H9azNx3xAj-MySg-uZ2SFqbWs4kZvf61JnK6b-h4Qw,4343
66
66
  dcicutils/zip_utils.py,sha256=rnjNv_k6L9jT2SjDSgVXp4BEJYLtz9XN6Cl2Fy-tqnM,2027
67
- dcicutils-8.7.0.1b24.dist-info/LICENSE.txt,sha256=qnwSmfnEWMl5l78VPDEzAmEbLVrRqQvfUQiHT0ehrOo,1102
68
- dcicutils-8.7.0.1b24.dist-info/METADATA,sha256=6tmLbZ6YEomGqF46gxsNURe-92nPNIiFkurTxUhjnCg,3315
69
- dcicutils-8.7.0.1b24.dist-info/WHEEL,sha256=7Z8_27uaHI_UZAc4Uox4PpBhQ9Y5_modZXWMxtUi4NU,88
70
- dcicutils-8.7.0.1b24.dist-info/entry_points.txt,sha256=8wbw5csMIgBXhkwfgsgJeuFcoUc0WsucUxmOyml2aoA,209
71
- dcicutils-8.7.0.1b24.dist-info/RECORD,,
67
+ dcicutils-8.7.0.1b26.dist-info/LICENSE.txt,sha256=qnwSmfnEWMl5l78VPDEzAmEbLVrRqQvfUQiHT0ehrOo,1102
68
+ dcicutils-8.7.0.1b26.dist-info/METADATA,sha256=Qq3W6hpTaEuDnAAZpv0NFpmBHPra6gzi9Uo6tCciBjw,3315
69
+ dcicutils-8.7.0.1b26.dist-info/WHEEL,sha256=7Z8_27uaHI_UZAc4Uox4PpBhQ9Y5_modZXWMxtUi4NU,88
70
+ dcicutils-8.7.0.1b26.dist-info/entry_points.txt,sha256=8wbw5csMIgBXhkwfgsgJeuFcoUc0WsucUxmOyml2aoA,209
71
+ dcicutils-8.7.0.1b26.dist-info/RECORD,,