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

Inconsistent use of paths #103

Open
oruebel opened this issue Sep 19, 2024 · 0 comments
Open

Inconsistent use of paths #103

oruebel opened this issue Sep 19, 2024 · 0 comments

Comments

@oruebel
Copy link
Contributor

oruebel commented Sep 19, 2024

Different parts of the code assume path names with ending "/" and without ending "/". For example, DynamicTable assumes that it's path ends with "/"

inline const static std::string electrodeTablePath =
"/general/extracellular_ephys/electrodes/";

path + name, "hdmf-common", "VectorData", colDescription);

path + "id", "hdmf-common", "ElementIdentifiers");

path + name, "hdmf-common", "VectorData", colDescription);

However, other Containers assume that path names do not have a "/" at the end, e.g., here:

this->timestampsType, tsDsetSize, chunkSize, getPath() + "/timestamps"));

In particular, all of these use the same variable "Container::path" that they inherit from "Container".

To avoid errors and ease use of the API, I propose to:

  1. Always use paths without ending "/"
  2. In the constructor of Container remove trailing "/" from the path
  3. Update DynamicTable and ElectrodeTable to not assume trailing "/"
  4. Add utility function for merging paths to account for trailing and non-trailing spaces
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

No branches or pull requests

1 participant