-
Notifications
You must be signed in to change notification settings - Fork 124
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
Add data access through BIDSFile #433
Comments
Is the polymorphism based on file extension a good idea? Suppose I do a query that can get multiple file types and don't think to check. If I always (or at least in some mistaken cases) get something useful with For example, if I thought I was reading a JSON file but instead read a TSV file, I might try to set a value in the dict, which actually creates a column in the DataFrame. We could instead try something like: def get_df(self):
if self.ext not in ('.tsv', '.tsv.gz'):
raise ValueError
# return pandas.DataFrame
def get_text(self):
# return contents as str
def get_dict(self):
# return dict interpretation
def get_image(self):
# return nibabel image Some of these could still apply to multiple image types, but the output type would be predictable. |
I'm not sure I see much of a use case for |
Sure, makes sense. I would prefer |
Yeah, there are |
Closed in #432. |
For
BIDSFile
objects associated with files containing text data (e.g., .tsv, tsv.gz, .json, etc.), users should be able to directly retrieve the contents (as aDataFrame
ordict
) via a.get_data()
method.The text was updated successfully, but these errors were encountered: