-
Notifications
You must be signed in to change notification settings - Fork 5
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
Fix subconverter stubbing #870
Conversation
On the File Metadata page, when I click Next to generate the stub file, I get:
Is there an easy way to show what those errors are? |
Oh wait. Never mind. I didn't specify subject sex or species. |
They showed up locally as flagged by errors and in red, right? |
Yes. I suggest we improve the error reporting to the user. The red popup just says "Error: 2 JSON Schema errors detected." But that's a separate issue and PR. The fix here did not work. I looked into why. It looks like when this line executes:
I think |
@rly Fix on NeuroConv was merged: catalystneuro/neuroconv#922 |
ping @rly |
The preview is still converting the whole dataset. I will poke around and see what I can figure out. |
Huh, thought you said it was working with the NeuroConv dev branch? |
That's so strange. I just tried again with the commit from catalystneuro/neuroconv#922 right before I commented, and it converted the whole dataset. I must not have checked thoroughly or done something odd when testing that neuroconv PR. Sorry about that.
I think https://github.com/catalystneuro/neuroconv/blob/main/src/neuroconv/nwbconverter.py#L158 is not set up to work with an After going down this rabbit hole, I am not sure what the best approach is. What do you think? Does this need to be addressed on the neuroconv side or here? progress_bar_options = dict(
mininterval=0,
on_progress_update=update_conversion_progress,
)
def update_conversion_options(converter_local, available_options_local, options_local):
if isinstance(converter_local, neuroconv.NWBConverter):
print(f"NWBConverter {converter_local} entered")
for name, subconverter in converter_local.data_interface_objects.items():
options_local[name] = {"conversion_options": {}}
print(f"{name} interface entered")
print(f"available_options_local: {available_options_local}")
print(f"options_local: {options_local}")
update_conversion_options(
subconverter,
available_options_local.get("properties").get(name),
options_local[name]["conversion_options"]
)
else:
print(f"{converter_local} interface entered")
available_opts = available_options_local.get("properties", {})
if run_stub_test and "stub_test" in available_opts:
options_local["stub_test"] = True
print(f"{converter_local} has been stubbed")
# if "iterator_opts" in available_opts:
# options_local["iterator_opts"] = dict(
# display_progress=True,
# progress_bar_class=TQDMProgressSubscriber,
# progress_bar_options=progress_bar_options,
# )
# Assume all interfaces have the same conversion options for now
available_options = converter.get_conversion_options_schema()
options = {interface: {} for interface in info["source_data"]}
update_conversion_options(converter, available_options, options)
# Add GUIDE watermark
package_json_file_path = resource_path("package.json" if is_packaged() else "../package.json")
# ... |
I'll take another look next week, busy the next couple of days |
This works with catalystneuro/neuroconv#979 now I will ping you again on this after NeuroConv PR is merged @rly |
Pull request was converted to draft
@rly Please give this a try and let me know