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

outputting links #48

Closed
bendichter opened this issue Jul 20, 2018 · 4 comments
Closed

outputting links #48

bendichter opened this issue Jul 20, 2018 · 4 comments
Assignees
Labels
category: enhancement improvements of code or code behavior priority: low alternative solution already working and/or relevant to only specific user(s) status: stale outdated or not relevant anymore

Comments

@bendichter
Copy link
Contributor

in the code

dev = types.core.Device( ...
    'source', ns_path);
file.general_devices.set('dev1', dev);

eg = types.core.ElectrodeGroup('source', ns_path, ...
    'description', 'a test ElectrodeGroup', ...
    'location', 'unknown', ...
    'device', types.untyped.SoftLink('/general/devices/dev1'));
file.general_extracellular_ephys.set('elec1', eg);

I don't like that you have to know the path of dev1 in order to link it. I think that makes it hard for new users that might not know the hierarchical structure of nwb-schema. How would you feel about having file.general_devices.set optionally output the SoftLink object if an output is requested?

so the new syntax would be

dev = types.core.Device( ...
    'source', ns_path);
dev_link = file.general_devices.set('dev1', dev);

eg = types.core.ElectrodeGroup('source', ns_path, ...
    'description', 'a test ElectrodeGroup', ...
    'location', 'unknown', ...
    'device', dev_link);
file.general_extracellular_ephys.set('elec1', eg);
@bendichter bendichter added the category: enhancement improvements of code or code behavior label Jul 20, 2018
@lawrence-mbf
Copy link
Collaborator

Since SoftLinks are expecting full paths it's a bit finicky if we just look at the subsref list. How do you think we should approach it this way?

Another possible idea is to use dot notation similar to one of MATLAB's options for edit:
https://www.mathworks.com/help/matlab/ref/edit.html?searchHighlight=edit&s_tid=doc_srchtitle#btk4bs6-file
Basically, instead of:
types.untyped.SoftLink('/general/devices/dev1')
We have:
types.untyped.SoftLink('general_devices.dev1')
Implementing the above will require adding the functionality to io.resolvePath (trivial) as well as a converter for export functions (not as trivial).

@bendichter
Copy link
Contributor Author

Yeah I proposed this and then attempted to implement it and realized it will be non-trivial. It's still on my wishlist but I'd say not a priority for me.

@bendichter bendichter added the priority: low alternative solution already working and/or relevant to only specific user(s) label Jul 21, 2018
@ehennestad ehennestad added the status: stale outdated or not relevant anymore label Oct 31, 2024
@ehennestad
Copy link
Collaborator

@bendichter Is this issue relevant anymore as it is now possible to pass other objects/nwb types to types.untyped.SoftLink?

@bendichter
Copy link
Contributor Author

This has been fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: enhancement improvements of code or code behavior priority: low alternative solution already working and/or relevant to only specific user(s) status: stale outdated or not relevant anymore
Projects
None yet
Development

No branches or pull requests

3 participants