-
Notifications
You must be signed in to change notification settings - Fork 15
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
Registry #94
Conversation
self.file_path = None | ||
|
||
def _find_file(self, file_name: str) -> None: | ||
self.file_name = file_name |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it would be self.file_id = file_id,
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think so - I decided to have it saved as file_name and don't use file_id anywhere in this class or file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are you just asking me to rename it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, just renaming it haha. Although, we should keep it consistent through the entire package. I call file name at the literal file name "1XYZ.pdb" for example
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not saying im perfect, im almost certain I overlooked this somewhere
if type(plot_result) == str: | ||
return "Figures created: " + plot_result | ||
else: | ||
return "No figures created." | ||
except ValueError: | ||
return "No timestep data found in csv file." | ||
return "File could not be processed." | ||
except FileNotFoundError: | ||
return "Issue with CSV file, file not found." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here I usually describe the problem stating that the name/id is not in the path_registry. check again
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that error is caught earlier - I solved this by just returning the error that I raise previously in the code (I explicitly raise the error you are describing)
@@ -123,6 +123,9 @@ def compute_rmsd(self, selection="backbone", plot=True): | |||
plt.savefig(f"{self.filename}.png") | |||
# plt.close() # if you don't want to show the plot in notebooks | |||
message += f"Plotted RMSD over time. Saved to {self.filename}.png.\n" | |||
self.path_registry.map_path( | |||
f"{self.filename}.png", f"{self.filename}.png", message |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now that i notice, plots are not included in the files yet. Therefore, they don't have an ID. We could include them as records.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what do you recommend here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So far ive been going with a "simple" approach. Anything that comes as an output from the simulation is a record, everything that ends in .pdb is a pdb file, and simulations are saved as scripts.
Also if a file is a "child" of another file, ill just use that as part of the ID to keep it "traceable".
In this case, the plot comes from a Traj file with its time_stamp, so ill just give it an ID like it: REC0_TRAJ123456, where the number is the time stamp from the traj file.
message = rmsd.calculate_rmsd(rmsd_type, selection, plot) | ||
except ValueError as e: | ||
return ( | ||
f"ValueError: {e}. \nMake sure to provide valid PBD " | ||
"file and binding site using MDAnalysis selection syntax." | ||
) | ||
except FileNotFoundError as e: | ||
return str(e) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, i like to make this messages to the agent more descriptive.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I add the description above where I define the filenotfound error message
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
overall I like the new structure. Feels way more organized :). I had a couple comments, but I don't think they are critic, except for the ones regarding the files ids for plots. We can either continue with the ID we have so far for the same simulations: REC0,1,2_simid, or make a new one. I would think, that just keeping what we have, and making good descriptions should work :)
most of the description errors you are seeing is because I describe the error when defining it, not when returning it. We can chat soon about the file id |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This PR updates the tools to correctly use path registry and fixes minor bugs