docs: docstrings improved.

This commit is contained in:
Fabian Joswig 2022-01-28 15:21:38 +00:00
parent 1d41a664ee
commit c11410da5e
2 changed files with 25 additions and 17 deletions

View file

@ -367,9 +367,9 @@ def read_qtop(path, prefix, c, dtr_cnfg=1, version="1.2", **kwargs):
Parameters Parameters
---------- ----------
path: path : str
path of the measurement files path of the measurement files
prefix: prefix : str
prefix of the measurement files, e.g. <prefix>_id0_r0.ms.dat prefix of the measurement files, e.g. <prefix>_id0_r0.ms.dat
c : double c : double
Smearing radius in units of the lattice extent, c = sqrt(8 t0) / L Smearing radius in units of the lattice extent, c = sqrt(8 t0) / L
@ -545,11 +545,19 @@ def read_qtop(path, prefix, c, dtr_cnfg=1, version="1.2", **kwargs):
def read_qtop_sector(target=0, **kwargs): def read_qtop_sector(target=0, **kwargs):
"""target: int """Constructs reweighting factors to a specified topological sector.
specifies the topological sector to be reweighted to (default 0)
Parameters
----------
target : int
Specifies the topological sector to be reweighted to (default 0)
q_top : Obs q_top : Obs
alternatively takes args of read_qtop method as kwargs Alternatively takes args of read_qtop method as kwargs
""" """
if not isinstance(target, int):
raise Exception("'target' has to be an integer.")
if "q_top" in kwargs: if "q_top" in kwargs:
qtop = kwargs.get("q_top") qtop = kwargs.get("q_top")
else: else:

View file

@ -79,7 +79,7 @@ def _assert_equal_properties(ol, otype=Obs):
if not isinstance(o, otype): if not isinstance(o, otype):
raise Exception("Wrong data type in list.") raise Exception("Wrong data type in list.")
if not ol[0].is_merged == o.is_merged: if not ol[0].is_merged == o.is_merged:
raise Exception("All Obs in list have to be defined on the same set of configs.") raise Exception("All Obs in list have to have the same state 'is_merged'.")
if not ol[0].reweighted == o.reweighted: if not ol[0].reweighted == o.reweighted:
raise Exception("All Obs in list have to have the same property 'reweighted'.") raise Exception("All Obs in list have to have the same property 'reweighted'.")
if not ol[0].e_content == o.e_content: if not ol[0].e_content == o.e_content: