Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

oda:DataProduct output has no type_key required for output #129

Closed
ferrigno opened this issue Jan 10, 2025 · 0 comments · Fixed by #130
Closed

oda:DataProduct output has no type_key required for output #129

ferrigno opened this issue Jan 10, 2025 · 0 comments · Fixed by #130
Assignees
Labels
bug Something isn't working

Comments

@ferrigno
Copy link
Contributor

ferrigno commented Jan 10, 2025

A line as this one in the outputs-tagged cell
rmf = jemx_rmf_dp # oda:DataProduct ; oda:label "RMF file"
causes the error

File /opt/conda/lib/python3.10/site-packages/nb2workflow/nbadapter.py:1183, in validate_oda_dispatcher(nba, optional, machine_readable)
   1179 prod_list = nbpq.build_product_list(instrument=None, res=MockRes, out_dir=None)
   1181 for prod in prod_list:
   1182     logger.info("\033[33mworkflow the output produces ODA product \033[0m: \033[31m%s\033[0m (%s) %s", 
-> 1183                 prod.name, prod.type_key, prod)
   1185 if machine_readable:
   1186     print("WORKFLOW-DISPATCHER-SIGNATURE:", json.dumps([
   1187                 {"parameters": dispatcher_parameters,
   1188                  "outputs": [{'name': prod.name, 'type': prod.type_key, 'class_name': prod.__class__.__name__} for prod in prod_list]
   1189                 }]))

AttributeError: 'NB2WProduct' object has no attribute 'type_key'

This is because the class
class NB2WProduct: (line 39 of products.py) has no attribute type_key which is defined only for the derived classes.

As the NB2WProduct constructor is valid only for NumpyDataProduct-based products, I propose the associated PR

@ferrigno ferrigno added the bug Something isn't working label Jan 10, 2025
@ferrigno ferrigno transferred this issue from oda-hub/nb2workflow Jan 10, 2025
@ferrigno ferrigno linked a pull request Jan 10, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants