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

Enable users to remove gid from filename in recording devices #760

Merged
merged 5 commits into from Jul 19, 2017

Conversation

Projects
None yet
4 participants
@weidel-p
Contributor

weidel-p commented Jun 20, 2017

Hi,

with this PR I'd like to give the user more power over the filename of recording_devices. So far, the GID of the device is a obligatory part of the filename. This can be annoying during the development of network models as the GID might change quite often.

I introduced a field called use_gid as a parameter of the recording_device which, if turned off, makes the recording_device neglect its GID in the filename. As this can lead to more collisions of filenames, this mechanism only works if the user has set a prefix for the filename.

@abigailm

all good except for the critical bit.

Show outdated Hide outdated nestkernel/recording_device.cpp
@abigailm

This comment has been minimized.

Show comment
Hide comment
@abigailm

abigailm Jun 29, 2017

Contributor

👍

Contributor

abigailm commented Jun 29, 2017

👍

@jougs

I'm a bit sceptical that this change is a good idea. For example, what would happen if a user sets the same label for two devices on the same VP? Will NEST crash? Or will the data in the file be corrupted? I'm afraid that this leads to hard-to-debug errors as we can't easily guarantee that the labels are unique. Can you please test these kinds of situations and report back?

Also, the feature needs documentation in the SLI docstring of RecordingDevice and possibly also somewhere in the NEST user manual.

For more general remarks on the code see my inline comments.

Show outdated Hide outdated nestkernel/nest_names.cpp
Show outdated Hide outdated nestkernel/nest_names.h
Show outdated Hide outdated nestkernel/recording_device.cpp
@weidel-p

This comment has been minimized.

Show comment
Hide comment
@weidel-p

weidel-p Jun 30, 2017

Contributor

I renamed use_gid to use_gid_in_filename, extended the docstring and added a BadPropertyException.

If a user sets the same label for different devices and sets use_gid_in_filename to false, NEST first throws the usual IOError:

The device file 'spike_detector-0.gdf' exists already and will not be  overwritten. 
Please change data_path, data_prefix or label, or set 
/overwrite_files to true in the root node.

The data only gets corrupted, if the user sets overwrite_files to true.

I understand your concerns and also see the possible risks in this feature but I think the user is well enough protected by being forced to give a label and by the IOError.

Contributor

weidel-p commented Jun 30, 2017

I renamed use_gid to use_gid_in_filename, extended the docstring and added a BadPropertyException.

If a user sets the same label for different devices and sets use_gid_in_filename to false, NEST first throws the usual IOError:

The device file 'spike_detector-0.gdf' exists already and will not be  overwritten. 
Please change data_path, data_prefix or label, or set 
/overwrite_files to true in the root node.

The data only gets corrupted, if the user sets overwrite_files to true.

I understand your concerns and also see the possible risks in this feature but I think the user is well enough protected by being forced to give a label and by the IOError.

@jougs

This comment has been minimized.

Show comment
Hide comment
@jougs

jougs Jul 11, 2017

Contributor

Sorry to be nagging about this, but: please rename all occurences of use_gid to use_gid_in_filename. Otherwise this gets really confusing and the function of this variable is not clear outside of the recording context. Thanks!

Contributor

jougs commented Jul 11, 2017

Sorry to be nagging about this, but: please rename all occurences of use_gid to use_gid_in_filename. Otherwise this gets really confusing and the function of this variable is not clear outside of the recording context. Thanks!

@weidel-p

This comment has been minimized.

Show comment
Hide comment
@weidel-p

weidel-p Jul 18, 2017

Contributor

@jougs I changed every occurrence of use_gid to use_gid_in_filename. Additionally, I added two tests to this PR.

Contributor

weidel-p commented Jul 18, 2017

@jougs I changed every occurrence of use_gid to use_gid_in_filename. Additionally, I added two tests to this PR.

@jougs

jougs approved these changes Jul 19, 2017

@weidel-p: many thanks for the fixes. The code now looks good to me and I'l merge, given that @abigailm already approved.

@jougs jougs merged commit 1df2ff0 into nest:master Jul 19, 2017

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment