Skip to content

Commit

Permalink
Merge pull request #51 from MolarVerse/feature/format_yapf
Browse files Browse the repository at this point in the history
Feature/format yapf
  • Loading branch information
97gamjak authored May 11, 2024
2 parents c1954e5 + cafcaa0 commit cf8c754
Show file tree
Hide file tree
Showing 117 changed files with 2,511 additions and 1,272 deletions.
16 changes: 12 additions & 4 deletions PQAnalysis/analysis/rdf/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
from .rdf_output_file_writer import RDFDataWriter, RDFLogWriter



@runtime_type_checking
def rdf(input_file: str, md_format: MDEngineFormat | str = MDEngineFormat.PQ):
"""
Expand Down Expand Up @@ -49,17 +50,24 @@ def rdf(input_file: str, md_format: MDEngineFormat | str = MDEngineFormat.PQ):

if input_reader.moldescriptor_file is not None:
moldescriptor_reader = MoldescriptorReader(
input_reader.moldescriptor_file)
input_reader.moldescriptor_file
)
reference_residues = moldescriptor_reader.read()
else:
reference_residues = None

if topology is not None:
topology = Topology(atoms=topology.atoms, residue_ids=topology.residue_ids,
reference_residues=reference_residues)
topology = Topology(
atoms=topology.atoms,
residue_ids=topology.residue_ids,
reference_residues=reference_residues
)

traj_reader = TrajectoryReader(
input_reader.traj_files, md_format=md_format, topology=topology)
input_reader.traj_files,
md_format=md_format,
topology=topology
)

_rdf = RDF(
traj=traj_reader,
Expand Down
4 changes: 4 additions & 0 deletions PQAnalysis/analysis/rdf/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
from ...exceptions import PQException, PQWarning



class RDFError(PQException):

"""
Exception raised if something goes wrong during the RDF setup or calculation.
"""
Expand All @@ -22,7 +24,9 @@ def __init__(self, message: str) -> None:
super().__init__(self.message)



class RDFWarning(PQWarning):

"""
Warning raised if something goes wrong during the RDF setup or calculation.
"""
Expand Down
Loading

0 comments on commit cf8c754

Please sign in to comment.