diff --git a/.buildinfo b/.buildinfo
index 2494979..571e96f 100644
--- a/.buildinfo
+++ b/.buildinfo
@@ -1,4 +1,4 @@
# Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
-config: 9278f69af22cbd44e124cda9e072af79
+config: f4b66b4faf93049c2673802b4abcd902
tags: 645f666f9bcd5a90fca523b33c5a78b7
diff --git a/_modules/forcefield_step/forcefield.html b/_modules/forcefield_step/forcefield.html
index 5e3d954..8c76e48 100644
--- a/_modules/forcefield_step/forcefield.html
+++ b/_modules/forcefield_step/forcefield.html
@@ -7,35 +7,35 @@
"""The git version of this module."""returnforcefield_step.__git_revision__
+ @property
+ deffiles(self):
+"""The files in the forcefield ... (short name & full path)"""
+ returnself._files
+
)# Atom types
- logger.debug("Atom typing, getting the SMILES for the system")
+ self.logger.debug("Atom typing, getting the SMILES for the system")smiles=configuration.to_smiles(hydrogens=True)
- logger.debug("Atom typing -- smiles = "+smiles)
+ self.logger.debug("Atom typing -- smiles = "+smiles)ff_assigner=seamm_ff_util.FFAssigner(ff)atom_types=ff_assigner.assign(configuration)
- logger.info("Atom types: "+", ".join(atom_types))
+ self.logger.info("Atom types: "+", ".join(atom_types))key=f"atom_types_{ffname}"ifkeynotinconfiguration.atoms:configuration.atoms.add_attribute(key,coltype="str")
@@ -662,11 +665,11 @@
Source code for forcefield_step.forcefield
# Now get the charges if forcefield has them.terms=ff.data["forcefield"][ffname]["parameters"]if"bond_increments"interms:
- logger.debug("Getting the charges for the system")
+ self.logger.debug("Getting the charges for the system")neighbors=configuration.bonded_neighbors(as_indices=True)
- logger.debug(f"{atom_types=}")
- logger.debug(f"{neighbors=}")
+ self.logger.debug(f"{atom_types=}")
+ self.logger.debug(f"{neighbors=}")charges=[]total_q=0.0
@@ -681,19 +684,21 @@
Source code for forcefield_step.forcefield
charges.append(q)total_q+=qifabs(total_q)>0.0001:
- logger.warning("Total charge is not zero: {}".format(total_q))
- logger.info(
+ self.logger.warning("Total charge is not zero: {}".format(total_q))
+ self.logger.info("Charges from increments and charges:\n"+pprint.pformat(charges))else:
- logger.debug("Charges from increments:\n"+pprint.pformat(charges))
+ self.logger.debug(
+ "Charges from increments:\n"+pprint.pformat(charges)
+ )key=f"charges_{ffname}"ifkeynotinconfiguration.atoms:configuration.atoms.add_attribute(key,coltype="float")charge_column=configuration.atoms.get_column(key)charge_column[0:]=charges
- logger.debug(f"Set column '{key}' to the charges")
+ self.logger.debug(f"Set column '{key}' to the charges")printer.important(__(
@@ -703,7 +708,7 @@
Source code for forcefield_step.forcefield
))elif"charges"interms:
- logger.debug("Getting the charges for the system")
+ self.logger.debug("Getting the charges for the system")charges=[]total_q=0.0
@@ -714,17 +719,17 @@
Source code for forcefield_step.forcefield
charges.append(q)total_q+=qifabs(total_q)>0.0001:
- logger.warning("Total charge is not zero: {}".format(total_q))
- logger.info("Charges from charges:\n"+pprint.pformat(charges))
+ self.logger.warning("Total charge is not zero: {}".format(total_q))
+ self.logger.info("Charges from charges:\n"+pprint.pformat(charges))else:
- logger.debug("Charges from charges:\n"+pprint.pformat(charges))
+ self.logger.debug("Charges from charges:\n"+pprint.pformat(charges))key=f"charges_{ffname}"ifkeynotinconfiguration.atoms:configuration.atoms.add_attribute(key,coltype="float")charge_column=configuration.atoms.get_column(key)charge_column[0:]=charges
- logger.debug(f"Set column '{key}' to the charges")
+ self.logger.debug(f"Set column '{key}' to the charges")printer.important(__(
@@ -742,6 +747,56 @@
__(" Using the forcefield '{forcefield}'",**P,
- indent=self.indent+" ",
+ indent=self.indent+4*" ",))ff.initialize_biosym_forcefield(P["forcefield"])
+
+
+
+[docs]
+ defuri_handler(self,path):
+"""Return the actual file given a path that may have a uri.
+
+ Parameters
+ ----------
+ path : str or pathlib.Path
+ The filename or uri for the file.
+
+ Returns
+ -------
+ path : pathlib.Path
+ The full path to the file
+
+ Note
+ ----
+ Forcefields can be in one of 3 locations:
+
+ 1. In the data directory of this Python package. This is where the standard
+ forcefields are stored.
+
+ 2. In the local installation, under ~/SEAMM/data/Forcefields. This allows a
+ site to add or customize forcefields for all users. The user for the
+ SEAMM installation may not be the same as the user running the code! So
+ '~/' may reference a different directory than the next item.
+
+ 3. In the users directory at ~/seamm.d/data/Forcefields. This allows the
+ user to add or override any existing forcefield.
+
+ When a forcefield is referenced, if it has no URI it is assumed to be in (1),
+ the default location for forcefields shipped with the release.
+
+ If it has a URI, i.e. the path starts with 'local:', the code searches for it
+ first in the users local data (3). If it is not found, the search continues in
+ site location (2).
+
+ Jobs executed by the JobServer are handled a bit differently, because the site
+ and home directories may not exist or may be different on the machine that the
+ JobServer is running on. When a job is submitted to the Dashboard, the code
+ locates the forcefields on the local machine, as outlined above. It then sends
+ copies to the data/Forcefields directory of the job. The path for the job's
+ data/ driectory is changed to its local data/ directory, so the copies sent with
+ the job are used.
+ """
+ filename=str(path)
+ iffilename.startswith("local:"):
+ filename="Forcefields/"+filename[6:]
+ returnself.find_data_file(filename)
+ else:
+ returnPath(path).expanduser().resolve()