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

Add auto-time-update flag to NIXpy file #385

Merged
merged 5 commits into from
May 2, 2019
Merged

Conversation

hkchekc
Copy link
Member

@hkchekc hkchekc commented Apr 11, 2019

Refer to the issue #368

I added a flag for timestamp updating when the file is opened. 2 functions (time_auto_update_on() and time_auto_update_off()) are added for altering the flag after the file is opened.

The current policy is to update the time whenever a property of an Entity or File is changed and when the time_auto_update flag is True. I do not put the flag in the force_update_at() function because it is more flexible this way. Note that the update of metatdata will not change the update_at() time anyway.

The force_update_at() in creation is not affected.

As of the performance issue, the time used for changing the expansion_origin for data_array 100,000 times is:

EDITED:

always update (without a flag): around 45s
flag = True: around 45s (possibly slower for sections or property)
flag = False: around 20s
do not provide an auto_update possibility at all: around 20s (slightly less than flag = False)

@hkchekc hkchekc force-pushed the time branch 4 times, most recently from 4311162 to 9c81fa7 Compare April 11, 2019 17:25
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.09%) to 89.541% when pulling 4311162 on hkchekc:time into 50a156e on G-Node:master.

@coveralls
Copy link

coveralls commented Apr 11, 2019

Coverage Status

Coverage decreased (-0.3%) to 89.328% when pulling f5b019c on hkchekc:time into 50a156e on G-Node:master.

@achilleas-k
Copy link
Member

I don't think the auto-update setting should be stored in the file. This should be a session option, much like the compression flag and the open mode.

I also don't see the reason for having two methods, one for turning it off and one for on. Why not a property nixfile.auto_update_timestamps = {True,False}?

nixio/file.py Outdated Show resolved Hide resolved
@achilleas-k
Copy link
Member

Failing test is due to mismatching File Format versions with NIX breaking a compatibility test. Will be fixed by #386.

@achilleas-k achilleas-k merged commit bb99824 into G-Node:master May 2, 2019
@hkchekc hkchekc deleted the time branch May 9, 2019 12:23
@achilleas-k achilleas-k mentioned this pull request May 4, 2020
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

Successfully merging this pull request may close these issues.

3 participants