Commit da219513 authored by julian.gethmann's avatar julian.gethmann

Fix typos in documentation

* Break lines and replace cls with class
parent 7c496a76
......@@ -17,19 +17,23 @@ Beside the examples given here, *please* also have look at the examples given in
Scripts
-------
At the moment there is just the `get_mean_values` :ref:`scripts <scripts>` that you can call with the `-h` or `--help` option flag to get further information how to use it. Please feel free to provide an example.
At the moment there is just the `get_mean_values` :ref:`scripts <scripts>` that you can call with the `-h` or `--help`
option flag to get further information how to use it. Please feel free to provide an example.
Classes
-------
Context manager (with Cassandra(...))
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Let's say we want to have the time a specific fill started, then we can ask the Cassandra-DB to provide us the fill numbers for the time range of the beginning of the data logging (let's say 1st Jan, 2005) till today.
Let's say we want to have the time a specific fill started, then we can ask the Cassandra-DB to provide us the fill
numbers for the time range of the beginning of the data logging (let's say 1st Jan, 2005) till today.
This could be done with the following function that uses the Cassanda's context manager (with statement) to also care about exceptions.
This could be done with the following function that uses the Cassanda's context manager (with statement) to also care
about exceptions.
The context manager needs at least the start and end date and time for which it should ask for data and the process variable (PV) name.
So in our case this could something like :obj:`datetime.datetime(2005, 1, 1, 0, 0, 1)` as `start` and `datetime.datetime.now()` as `end`. The PV name is `'A:SR:OperationStatus:01:FillNumber'`.
So in our case this could something like :obj:`datetime.datetime(2005, 1, 1, 0, 0, 1)` as `start` and
`datetime.datetime.now()` as `end`. The PV name is `'A:SR:OperationStatus:01:FillNumber'`.
Putting it together this gives us
......@@ -46,12 +50,14 @@ Putting it together this gives us
Now the `times` list has got all the datetimes of the fill numbers that are in the `fills` list as integers.
Since we did not provide any number for the optional argument `count` the number of entries is not known and we need not to have one entry for each fill.
As it is not always convenient to provide :obj:`datetime.datetime` objects, you can also write the `start` and `end` date as strings in some common formats, like ISO-8601 or CSS-exports' format or the format used by the THz group.
As it is not always convenient to provide :obj:`datetime.datetime` objects, you can also write the `start` and `end` date
as strings in some common formats, like ISO-8601 or CSS-exports' format or the format used by the THz group.
For an explanation of the `count` argument see the documentation of Cassandra-DB's web-interface in the Confluence wiki.
The also optional argument `directory` does not make sense for the context manager, and is there for creating objects.
Now we can create another simple example that utilises the above mentioned string format, the count argument and uses the helper class :class:`cassandra.cassandra.Pvs`.
Now we can create another simple example that utilises the above mentioned string format, the count argument and uses
the helper class :class:`cassandra.cassandra.Pvs`.
* The starting time, which we will provide as the string `"2005/01/01 00:00:01"`,
* the end time, which we may give as a :obj:`datetime.datetime` object,
......@@ -87,7 +93,8 @@ We end up with a code that might look like:
fill_to_time(6000)
The `data` object we get from the handler is a :obj:`tuple` of two :obj:`list` s that contain the date stamps as :obj:`datetime.datetime` returned from Cassandra and the corresponding data. In our case the latter are the fill numbers.
The `data` object we get from the handler is a :obj:`tuple` of two :obj:`list` s that contain the date stamps as
:obj:`datetime.datetime` returned from Cassandra and the corresponding data. In our case the latter are the fill numbers.
Cassandra objects
~~~~~~~~~~~~~~~~~
......
......@@ -6,10 +6,13 @@ Scripts
Get mean values
---------------
This package ships with a comand line program that is called `get_mean_values` and that can print you the mean values for a given PV and time range.
This package ships with a command line program that is called `get_mean_values` and that can print you the mean values
for a given PV and time range.
.. warning::
At the time of writing this docu there is a bug in the script. It calculates the mean values of the returned values, which is not the actual mean, because the values are not equaly spaced in time. See issue #13 in the issue tracker for more info on this.
At the time of writing this docu there is a bug in the script. It calculates the mean values of the returned values,
which is not the actual mean, because the values are not equaly spaced in time. See issue #13 in the issue tracker
for more info on this.
Legacy script with proxy functionality
......@@ -18,7 +21,9 @@ Legacy script with proxy functionality
Furthermore there is a script located at `src/cassandra/fetch.py` which downloads data for a PV and plots it.
This package is based on that script, though it improved massively.
The reason why it is still there is that one can use it if one just has got an account on `las-bernhard.anka.kit.edu`, but no access to the IBPT-LAN. In that case it downloads the data to this computer and then to your computer.
To use this script you need to modify the `main()` function and adjust the `start_time`, `end_time` and `pvi` variable. For further information read the docstring and search for `Edit this variables` in the script.
The reason why it is still there is that one can use it if one just has got an account on `las-bernhard.anka.kit.edu`,
but no access to the IBPT-LAN. In that case it downloads the data to this computer and then to your computer.
To use this script you need to modify the `main()` function and adjust the `start_time`, `end_time` and `pvi` variable.
For further information read the docstring and search for `Edit this variables` in the script.
Anyhow I would suggest to ask for IBPT-LAN access.
......@@ -6,14 +6,14 @@
This module provides three classes.
The main class is the :cls:`Cassandra` with which one can get data out of
The main class is the :class:`Cassandra` with which one can get data out of
KARA's Cassandra database using the JSON webfrontend.
The :cls:`CassandraHelper` class provides helper functions especially to
The :class:`CassandraHelper` class provides helper functions especially to
deal with the different time formats that are used in Python, Cassandra's
webfrontend and the CSS export.
And finally the :cls:`Pvs` class simply provides a :obj:`dict` of some
And finally the :class:`Pvs` class simply provides a :obj:`dict` of some
EPICS Process Variables I often used or could not remember.
"""
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment