Skip to content
Snippets Groups Projects
Verified Commit d9cc7e88 authored by Daniel Hornung's avatar Daniel Hornung
Browse files

DOC: Sphinx now has hardly any errors left.

parent 45efa075
Branches
Tags
1 merge request!100WIP: Filling XLSX: Seems to be working.
Pipeline #49655 passed
......@@ -27,12 +27,14 @@
CaosDB can automatically be filled with Records based on some structure, a file
structure, a table or similar.
The Crawler will iterate over the respective items and test for each item
whether a CFood class exists that matches the file path, i.e. whether CFood
class wants to treat that pariticular item. If one does, it is instanciated to
treat the match. This occurs in basically three steps:
1. Create a list of identifiables, i.e. unique representation of CaosDB Records
(such as an experiment belonging to a project and a date/time).
(such as an experiment belonging to a project and a date/time).
2. The identifiables are either found in CaosDB or they are created.
3. The identifiables are update based on the date in the file structure.
"""
......@@ -333,7 +335,7 @@ class AbstractFileCFood(AbstractCFood):
out : str
The regular expression, starting with ``.*\\.`` and ending with the EOL dollar
character. The actual extension will be accessible in the
:py:attribute:`pattern group name<python:re.Pattern.groupindexe>` ``ext``.
:py:attr:`pattern group name <python:re.Pattern.groupindex>` ``ext``.
"""
if not extensions:
......
......@@ -22,8 +22,7 @@
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
"""A CFood for hdf5 files
"""A CFood for hdf5 files.
This module allows to parse hdf5 files and reproduce their structure in form
of Records that reference each other.
......@@ -130,7 +129,7 @@ class H5CFood(AbstractFileCFood):
@staticmethod
def get_re():
"""Return a regular expression string to match *.h5, *.nc, *.hdf, *.hdf5."""
"""Return a regular expression string to match ``*.h5``, ``*.nc``, ``*.hdf``, ``*.hdf5``."""
extensions = [
"h5",
"nc",
......
......@@ -575,8 +575,8 @@ def recordtype_to_json_schema(rt: db.RecordType, additional_properties: bool = T
wrap_files_in_objects : bool, optional
Whether (lists of) files should be wrapped into an array of objects that
have a file property. The sole purpose of this wrapping is to provide a
workaround for a `react-jsonschema-form
bug<https://github.com/rjsf-team/react-jsonschema-form/issues/3957>`_ so
workaround for a `react-jsonschema-form bug
<https://github.com/rjsf-team/react-jsonschema-form/issues/3957>`_ so
only set this to True if you're using the exported schema with
react-json-form and you are experiencing the bug. Default is False.
......
......@@ -38,7 +38,7 @@ Das aufgerufene Skript kann beliebige Eigenschaften benutzen und erstellen.
ABER wenn die Standardeigenschaften (InputDataSet, etc) verwendet werden, kann
der Record leicht erzeugt werden.
.. code-block::
"Analyze" "Perform Anlysis"
Knopf an Record Form im WebUI
......
......@@ -16,8 +16,11 @@ class SuppressKnown(logging.Filter):
added to the appropriate Logger and logging calls (e.g. to warning, info
etc.) need to have an additional `extra` argument.
This argument should be a dict that contains an identifier and a category.
Example: `extra={"identifier":"<Record>something</Record>",
category="entities"}
Example::
extra={"identifier":"<Record>something</Record>", category="entities"}
The identifier is used to check whether a message was shown before and
should be a string. The category can be used to remove a specific group of
messages from memory and the logger would show those messages again even
......@@ -74,9 +77,7 @@ class SuppressKnown(logging.Filter):
return sha256((txt+str(identifier)).encode("utf-8")).hexdigest()
def filter(self, record):
"""
Return whether the record shall be logged.
"""Return whether the record shall be logged.
If either identifier of category is missing 1 is returned (logging
enabled). If the record has both attributes, it is checked whether the
......
......@@ -113,17 +113,22 @@ def read_field_as_list(field):
return [field]
def get_referenced_files(glob, prefix=None, filename=None, location=None):
def get_referenced_files(glob: str, prefix: str = None, filename: str = None, location: str = None):
"""
queries the database for files referenced by the provided glob
Parameters:
glob: the glob referencing the file(s)
prefix: the glob can be relative to some path, in that case that path needs
to be given as prefix
filename: the file in which the glob is given (used for error messages)
location: the location in the file in which the glob is given (used for
error messages)
Parameters
----------
glob: str
the glob referencing the file(s)
prefix: str, optional
the glob can be relative to some path, in that case that path needs
to be given as prefix
filename: str, optional
the file in which the glob is given (used for error messages)
location: str, optional
the location in the file in which the glob is given (used for
error messages)
"""
orig_glob = glob
......@@ -161,16 +166,19 @@ def get_referenced_files(glob, prefix=None, filename=None, location=None):
return files
def check_win_path(path, filename=None):
def check_win_path(path: str, filename: str = None):
"""
check whether '/' are in the path but no '\'.
If that is the case, it is likely, that the path is not a Windows path.
Parameters:
path: path to be checked
filename: if the path is located in a file, this parameter can be used to
direct the user to the file where the path is located.
Parameters
----------
path: str
Path to be checked.
filename: str
If the path is located in a file, this parameter can be used to
direct the user to the file where the path is located.
"""
if r"\\" not in path and "/" in path:
......
......@@ -199,3 +199,7 @@ autodoc_default_options = {
'members': None,
'undoc-members': None,
}
autodoc_mock_imports = [
"caosadvancedtools.bloxberg",
"labfolder",
]
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment