clams-python 1.2.0__tar.gz → 1.2.1__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 (41) hide show
  1. {clams-python-1.2.0/clams_python.egg-info → clams_python-1.2.1}/PKG-INFO +1 -1
  2. clams_python-1.2.1/VERSION +1 -0
  3. {clams-python-1.2.0 → clams_python-1.2.1}/clams/app/__init__.py +5 -2
  4. {clams-python-1.2.0 → clams_python-1.2.1}/clams/develop/templates/app/app.py.template +1 -2
  5. clams_python-1.2.1/clams/ver/__init__.py +1 -0
  6. {clams-python-1.2.0 → clams_python-1.2.1/clams_python.egg-info}/PKG-INFO +1 -1
  7. clams-python-1.2.0/VERSION +0 -1
  8. clams-python-1.2.0/clams/ver/__init__.py +0 -1
  9. {clams-python-1.2.0 → clams_python-1.2.1}/LICENSE +0 -0
  10. {clams-python-1.2.0 → clams_python-1.2.1}/MANIFEST.in +0 -0
  11. {clams-python-1.2.0 → clams_python-1.2.1}/README.md +0 -0
  12. {clams-python-1.2.0 → clams_python-1.2.1}/clams/__init__.py +0 -0
  13. {clams-python-1.2.0 → clams_python-1.2.1}/clams/appmetadata/__init__.py +0 -0
  14. {clams-python-1.2.0 → clams_python-1.2.1}/clams/develop/__init__.py +0 -0
  15. {clams-python-1.2.0 → clams_python-1.2.1}/clams/develop/templates/app/.dockerignore.template +0 -0
  16. {clams-python-1.2.0 → clams_python-1.2.1}/clams/develop/templates/app/.gitignore.template +0 -0
  17. {clams-python-1.2.0 → clams_python-1.2.1}/clams/develop/templates/app/Containerfile.template +0 -0
  18. {clams-python-1.2.0 → clams_python-1.2.1}/clams/develop/templates/app/LICENSE.template +0 -0
  19. {clams-python-1.2.0 → clams_python-1.2.1}/clams/develop/templates/app/README.md.template +0 -0
  20. {clams-python-1.2.0 → clams_python-1.2.1}/clams/develop/templates/app/metadata.py.template +0 -0
  21. {clams-python-1.2.0 → clams_python-1.2.1}/clams/develop/templates/app/requirements.txt.template +0 -0
  22. {clams-python-1.2.0 → clams_python-1.2.1}/clams/develop/templates/gha/for-clams-team.md.template +0 -0
  23. {clams-python-1.2.0 → clams_python-1.2.1}/clams/develop/templates/gha/workflows/issue-apps-project.yml.template +0 -0
  24. {clams-python-1.2.0 → clams_python-1.2.1}/clams/develop/templates/gha/workflows/issue-assign.yml.template +0 -0
  25. {clams-python-1.2.0 → clams_python-1.2.1}/clams/develop/templates/gha/workflows/issue-close.yml.template +0 -0
  26. {clams-python-1.2.0 → clams_python-1.2.1}/clams/develop/templates/gha/workflows/publish.yml.template +0 -0
  27. {clams-python-1.2.0 → clams_python-1.2.1}/clams/mmif_utils/__init__.py +0 -0
  28. {clams-python-1.2.0 → clams_python-1.2.1}/clams/mmif_utils/rewind.py +0 -0
  29. {clams-python-1.2.0 → clams_python-1.2.1}/clams/mmif_utils/source.py +0 -0
  30. {clams-python-1.2.0 → clams_python-1.2.1}/clams/restify/__init__.py +0 -0
  31. {clams-python-1.2.0 → clams_python-1.2.1}/clams/serve/__init__.py +0 -0
  32. {clams-python-1.2.0 → clams_python-1.2.1}/clams_python.egg-info/SOURCES.txt +0 -0
  33. {clams-python-1.2.0 → clams_python-1.2.1}/clams_python.egg-info/dependency_links.txt +0 -0
  34. {clams-python-1.2.0 → clams_python-1.2.1}/clams_python.egg-info/entry_points.txt +0 -0
  35. {clams-python-1.2.0 → clams_python-1.2.1}/clams_python.egg-info/requires.txt +0 -0
  36. {clams-python-1.2.0 → clams_python-1.2.1}/clams_python.egg-info/top_level.txt +0 -0
  37. {clams-python-1.2.0 → clams_python-1.2.1}/requirements.txt +0 -0
  38. {clams-python-1.2.0 → clams_python-1.2.1}/setup.cfg +0 -0
  39. {clams-python-1.2.0 → clams_python-1.2.1}/setup.py +0 -0
  40. {clams-python-1.2.0 → clams_python-1.2.1}/tests/test_clamsapp.py +0 -0
  41. {clams-python-1.2.0 → clams_python-1.2.1}/tests/test_clamscli.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: clams-python
3
- Version: 1.2.0
3
+ Version: 1.2.1
4
4
  Summary: A collection of APIs to develop CLAMS app for python
5
5
  Home-page: https://clams.ai
6
6
  Author: Brandeis Lab for Linguistics and Computation
@@ -0,0 +1 @@
1
+ 1.2.1
@@ -122,7 +122,9 @@ class ClamsApp(ABC):
122
122
  if key not in self.annotate_param_spec:
123
123
  issued_warnings.append(UserWarning(f'An undefined parameter "{key}" (value: "{runtime_params[key]}") is passed'))
124
124
  # this will do casting + refinement altogether
125
+ self.logger.debug(f"User parameters: {runtime_params}")
125
126
  refined = self._refine_params(**runtime_params)
127
+ self.logger.debug(f"Refined parameters: {refined}")
126
128
  pretty = refined.get('pretty', False)
127
129
  with warnings.catch_warnings(record=True) as ws:
128
130
  annotated = self._annotate(mmif, **refined)
@@ -202,11 +204,12 @@ class ClamsApp(ABC):
202
204
  :param runtime_conf: runtime configuration of the app as k-v pairs
203
205
  """
204
206
  view.metadata.app = self.metadata.identifier
207
+ params_map = {p.name: p for p in self.metadata.parameters}
205
208
  if self._RAW_PARAMS_KEY in runtime_conf:
206
209
  for k, v in runtime_conf.items():
207
210
  if k == self._RAW_PARAMS_KEY:
208
211
  for orik, oriv in v.items():
209
- if orik in self.metadata.parameters and self.metadata.parameters[orik].multivalued:
212
+ if orik in params_map and params_map[orik].multivalued:
210
213
  view.metadata.add_parameter(orik, str(oriv))
211
214
  else:
212
215
  view.metadata.add_parameter(orik, oriv[0])
@@ -215,7 +218,7 @@ class ClamsApp(ABC):
215
218
  else:
216
219
  # meaning the parameters directly from flask or argparser and values are in lists
217
220
  for k, v in runtime_conf.items():
218
- if k in self.metadata.parameters and self.metadata.parameters[k].multivalued:
221
+ if k in params_map and params_map[k].multivalued:
219
222
  view.metadata.add_parameter(k, str(v))
220
223
  else:
221
224
  view.metadata.add_parameter(k, v[0])
@@ -13,7 +13,6 @@ The app.py script does several things:
13
13
 
14
14
  import argparse
15
15
  import logging
16
- from typing import Union
17
16
 
18
17
  # Imports needed for Clams and MMIF.
19
18
  # Non-NLP Clams applications will require AnnotationTypes
@@ -36,7 +35,7 @@ class $APP_CLASS_NAME(ClamsApp):
36
35
  # When using the ``metadata.py`` leave this do-nothing "pass" method here.
37
36
  pass
38
37
 
39
- def _annotate(self, mmif: Union[str, dict, Mmif], **parameters) -> Mmif:
38
+ def _annotate(self, mmif: Mmif, **parameters) -> Mmif:
40
39
  # see https://sdk.clams.ai/autodoc/clams.app.html#clams.app.ClamsApp._annotate
41
40
  raise NotImplementedError
42
41
 
@@ -0,0 +1 @@
1
+ __version__ = "1.2.1"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: clams-python
3
- Version: 1.2.0
3
+ Version: 1.2.1
4
4
  Summary: A collection of APIs to develop CLAMS app for python
5
5
  Home-page: https://clams.ai
6
6
  Author: Brandeis Lab for Linguistics and Computation
@@ -1 +0,0 @@
1
- 1.2.0
@@ -1 +0,0 @@
1
- __version__ = "1.2.0"
File without changes
File without changes
File without changes
File without changes
File without changes