Skip to content
This repository has been archived by the owner on Nov 2, 2021. It is now read-only.

spec4anything does not work for file in dataset-root #176

Open
pvavra opened this issue Mar 15, 2021 · 1 comment
Open

spec4anything does not work for file in dataset-root #176

pvavra opened this issue Mar 15, 2021 · 1 comment
Labels
bug Something isn't working

Comments

@pvavra
Copy link

pvavra commented Mar 15, 2021

In a new and empty dataset, the following does not work:

# in dataset root
touch somefile
datalad hirni-spec4anything somefile

The error message indicates that hirni is interpreting somefile as the acquisition folder:

[ERROR ] [Errno 20] Not a directory: '/home/.../bug_demo/somefile/studyspec.json' [json_py.py:dum2stream:121] (NotADirectoryError)

(NB: I removed the full path info)

However, moving the file into a subdir and rerunning works.

I think that hirni-spec4anything should also work on arbitrary files in the dataset-root, even though the use-cases might be few..
I came across this during testing of my behavior-logfile converter, which I do in a separate dataset without the dicom-acquisitions.

@bpoldrack
Copy link

I think that hirni-spec4anything should also work on arbitrary files in the dataset-root, even though the use-cases might be few..

I agree!

In fact you can do this, but it's not obvious how:
The error does not come from the given path, but from the default behavior for figuring the specification file to write to. This should be fixed - absolutely agree, but you can have what you want by circumventing the determination of the target file by specifying it:

datalad hirni-spec4anything --spec-file studyspec.json somefile does what you want.

@bpoldrack bpoldrack added the bug Something isn't working label Mar 15, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants