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

Port SpikeInterface update for tutorial generation #917

Draft
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

CodyCBakerPhD
Copy link
Collaborator

@CodyCBakerPhD CodyCBakerPhD commented Aug 21, 2024

fix #914
replace #916

GitHub was being slow to change the merge target (took like 10 minutes to allow merge) so in less time than that I just ported over the essential changes

Let's see what CI says

@CodyCBakerPhD CodyCBakerPhD self-assigned this Aug 21, 2024
@CodyCBakerPhD CodyCBakerPhD changed the title port over other PR Port SpikeInterface update for tutorial generation Aug 21, 2024
@CodyCBakerPhD
Copy link
Collaborator Author

Looks like GitHubs just having bad service all around today

@CodyCBakerPhD
Copy link
Collaborator Author

@alejoe91 Looks like we get this error: https://github.com/NeurodataWithoutBorders/nwb-guide/actions/runs/10491656279/job/29061326476?pr=917#step:13:178

Traceback (most recent call last):
  File "/home/runner/miniconda3/envs/nwb-guide/lib/python3.9/site-packages/flask/app.py", line 1484, in full_dispatch_request
    rv = self.dispatch_request()
  File "/home/runner/miniconda3/envs/nwb-guide/lib/python3.9/site-packages/flask/app.py", line 1469, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
  File "/home/runner/miniconda3/envs/nwb-guide/lib/python3.9/site-packages/flask_restx/api.py", line 404, in wrapper
    resp = resource(*args, **kwargs)
  File "/home/runner/miniconda3/envs/nwb-guide/lib/python3.9/site-packages/flask/views.py", line 109, in view
    return current_app.ensure_sync(self.dispatch_request)(**kwargs)
  File "/home/runner/miniconda3/envs/nwb-guide/lib/python3.9/site-packages/flask_restx/resource.py", line 46, in dispatch_request
    resp = meth(*args, **kwargs)
  File "/home/runner/work/nwb-guide/nwb-guide/src/pyflask/namespaces/data.py", line 19, in post
    generate_test_data(output_path=arguments["output_path"])
  File "/home/runner/work/nwb-guide/nwb-guide/src/pyflask/manageNeuroconv/manage_neuroconv.py", line [173](https://github.com/NeurodataWithoutBorders/nwb-guide/actions/runs/10491656279/job/29061326476?pr=917#step:13:174)6, in generate_test_data
    spikeinterface.exporters.export_to_phy(
  File "/home/runner/miniconda3/envs/nwb-guide/lib/python3.9/site-packages/spikeinterface/exporters/to_phy.py", line 184, in export_to_phy
    assert templates_ext is not None, "export_to_phy requires a SortingAnalyzer with the extension 'templates'"
AssertionError: export_to_phy requires a SortingAnalyzer with the extension 'templates'

Were you able to run the isolated helper function successfully on your end? (like, just a copy/paste into ipython or similar?)

@CodyCBakerPhD
Copy link
Collaborator Author

@alejoe91 Any ideas?

@CodyCBakerPhD
Copy link
Collaborator Author

@alejoe91 ping

@rly rly assigned rly and unassigned CodyCBakerPhD Nov 13, 2024
@rly
Copy link
Collaborator

rly commented Nov 13, 2024

DevTests pass but tutorial data generation is failing due to

Traceback (most recent call last):
  File "/home/runner/miniconda3/envs/nwb-guide/lib/python3.9/site-packages/flask/app.py", line 1484, in full_dispatch_request
    rv = self.dispatch_request()
  File "/home/runner/miniconda3/envs/nwb-guide/lib/python3.9/site-packages/flask/app.py", line 1469, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
  File "/home/runner/miniconda3/envs/nwb-guide/lib/python3.9/site-packages/flask_restx/api.py", line 404, in wrapper
    resp = resource(*args, **kwargs)
  File "/home/runner/miniconda3/envs/nwb-guide/lib/python3.9/site-packages/flask/views.py", line 109, in view
    return current_app.ensure_sync(self.dispatch_request)(**kwargs)
  File "/home/runner/miniconda3/envs/nwb-guide/lib/python3.9/site-packages/flask_restx/resource.py", line 46, in dispatch_request
    resp = meth(*args, **kwargs)
  File "/home/runner/work/nwb-guide/nwb-guide/src/pyflask/namespaces/neuroconv.py", line 68, in post
    return get_metadata_schema(
  File "/home/runner/work/nwb-guide/nwb-guide/src/pyflask/manageNeuroconv/manage_neuroconv.py", line 541, in get_metadata_schema
    map_interfaces(on_sorting_interface, converter=converter, to_match=BaseSortingExtractorInterface)
  File "/home/runner/work/nwb-guide/nwb-guide/src/pyflask/manageNeuroconv/manage_neuroconv.py", line 426, in map_interfaces
    result = callback(associated_name, interface)
  File "/home/runner/work/nwb-guide/nwb-guide/src/pyflask/manageNeuroconv/manage_neuroconv.py", line 476, in on_sorting_interface
    units_data = resolved_units[name] = get_unit_table_json(sorting_interface)
  File "/home/runner/work/nwb-guide/nwb-guide/src/pyflask/manageNeuroconv/manage_neuroconv.py", line 1877, in get_unit_table_json
    table_as_json = json.loads(json.dumps(table, cls=NWBMetaDataEncoder))
  File "/home/runner/miniconda3/envs/nwb-guide/lib/python3.9/json/__init__.py", line 231, in dumps
    return _default_encoder.encode(obj)
  File "/home/runner/miniconda3/envs/nwb-guide/lib/python3.9/json/encoder.py", line 199, in encode
    chunks = self.iterencode(o, _one_shot=True)
  File "/home/runner/miniconda3/envs/nwb-guide/lib/python3.9/json/encoder.py", line 257, in iterencode
    return _iterencode(o, 0)
  File "/home/runner/miniconda3/envs/nwb-guide/lib/python3.9/json/encoder.py", line 179, in default
    raise TypeError(f'Object of type {o.__class__.__name__} '
TypeError: Object of type int64 is not JSON serializable

NeuroConv's NWBMetaDataEncoder should already handle cases of scalar int64 and an array of int64. Not sure what is going on here. Compound types? Will debug locally when I have time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Creation of example data depends on old WaveformExtractor
2 participants