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

Check for the presence of the Relion lock directory before accessing default_pipeline.star #87

Merged
merged 3 commits into from
Apr 19, 2021

Conversation

d-j-hatton
Copy link
Contributor

Use a context manager to check for the presence of the .relion_lock directory before accessing the default_pipeline.star file. If it doesn't exist create it and remove it once the file has been read. If it does exist wait and try again; timeout after 20 attempts and store the information that there was a failure in the context manager. The method that reads the star file may then check for this failure and return an empty Document object instead of attempting to read the file. In the case of a failure the lock directory will not be removed on exit. Some restructuring has been done so that this lock is only applied when the file is actually being read and to allow the necessary information on which files to lock for to be passed from the Project class to the RelionPipeline class where the star file reading is done.

…e.star as pointed out by Colin. Added some functionality to pass the full path name of the lock directory to RelionPipeline
src/relion/__init__.py Outdated Show resolved Hide resolved
src/relion/_parser/relion_pipeline.py Outdated Show resolved Hide resolved
src/relion/__init__.py Outdated Show resolved Hide resolved
src/relion/__init__.py Outdated Show resolved Hide resolved
@codecov-commenter
Copy link

Codecov Report

Merging #87 (8b24bdd) into main (b92bb44) will increase coverage by 0.52%.
The diff coverage is 75.00%.

@@            Coverage Diff             @@
##             main      #87      +/-   ##
==========================================
+ Coverage   37.38%   37.90%   +0.52%     
==========================================
  Files          22       22              
  Lines        2798     2844      +46     
  Branches      428      433       +5     
==========================================
+ Hits         1046     1078      +32     
- Misses       1701     1711      +10     
- Partials       51       55       +4     

@d-j-hatton d-j-hatton merged commit ec5906e into main Apr 19, 2021
@d-j-hatton d-j-hatton deleted the relion-lock branch April 19, 2021 11:55
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