datajoint / datajoint-matlab

Relational data pipelines for the science lab
MIT License
42 stars 37 forks source link

Allow strings as well as char #431

Open bartkrekelberg opened 1 year ago

bartkrekelberg commented 1 year ago

Feature Request

Problem

On line 867 of dj.internal.Relvar attr.isString is equated with ischar(),, which disallows the use of Matlab strings . A simple fix would be to write
assert(ischar(value) || isstring(value), ... instead.

This has worked fine for me, but I did not check whether using string instead of char leads to problems elsewhere in the DJ code.

Requirements

Ideally, it should be possible to use string and vector of char interchangeably.

Justification

Alternative Considerations

Do you currently have a work-around for this? Provide any alternative solutions or features you've considered.

Related Errors

Add any errors as a direct result of not exposing this feature.

Please include steps to reproduce provided errors as follows:

Screenshots

If applicable, add screenshots to help explain your feature.

Additional Research and Context

Add any additional research or context that was conducted in creating this feature request.

For example:

guzman-raphael commented 1 year ago

@bartkrekelberg Thanks for your suggestion! This request seems reasonable and has come up before. One important consideration would be to ensure interoperability with DataJoint Python i.e. verify we can fetch the new records from DJ Python when inserted using DJ MATLAB.

If you are interested in taking this on by contribution, we'd be happy to help you along.

bartkrekelberg commented 1 year ago

I can give it a try. I forked the repo, do you want me to issue pull requests on the master or on some other development branch?