datajoint-matlab icon indicating copy to clipboard operation
datajoint-matlab copied to clipboard

Allow strings as well as char

Open bartkrekelberg opened this issue 2 years ago • 2 comments

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:

  • OS (WIN | MACOS | Linux)
  • MATLAB Version ; R2022b
  • MySQL Version
  • MySQL Deployment Strategy (local-native | local-docker | remote)
  • DataJoint Version 3.5.0
  • Minimum number of steps to reliably reproduce the issue
  • Complete error stack as a result of evaluating the above steps

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:

  • Related GitHub issues and PR's either within this repository or in other relevant repositories.
  • Specific links to specific lines or a focus within source code.
  • Relevant summary of Maintainers development meetings, milestones, projects, etc.
  • Any additional supplemental web references or links that would further justify this feature request.

bartkrekelberg avatar Mar 17 '23 11:03 bartkrekelberg

@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.

guzman-raphael avatar Mar 17 '23 17:03 guzman-raphael

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?

bartkrekelberg avatar Mar 22 '23 09:03 bartkrekelberg