Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update and clarify aspects in documentation #111

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions cats/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def parse_arguments():
********

CATS can be used to report information on the best time to run a calculation
and the amount of CO2. Information about a 90 minute calculation in centeral
and the amount of CO2. Information about a 90 minute calculation in central
Oxford can be found by running:

cats -d 90 --loc OX1
Expand All @@ -81,8 +81,7 @@ def parse_arguments():
To report carbon footprint, pass the `--config` option to select a
configuration file and the `--profile` option to select a profile.
The configuration file is documented in the Quickstart section of the online
documentation. An
example config file is given below:
documentation. An example config file is given below:

.. code-block:: yaml

Expand Down Expand Up @@ -170,12 +169,12 @@ def positive_integer(string):
parser.add_argument(
"--cpu",
type=positive_integer,
help="Number of cpus used by the job",
help="Number of CPUs used by the job",
)
parser.add_argument(
"--gpu",
type=positive_integer,
help="Number of cpus used by the job",
help="Number of GPUs used by the job",
)
parser.add_argument(
"--memory",
Expand Down
23 changes: 17 additions & 6 deletions docs/source/quickstart.rst
Original file line number Diff line number Diff line change
Expand Up @@ -45,18 +45,29 @@ Use the ``--config`` option to specify a path to the configuration
file, relative to the current directory.

In case of a missing location command line argument, ``cats`` looks
for a file named ``config.yaml`` in the current directory.
for a file named ``config.yaml`` or ``config.yml`` in the current directory.

.. code-block:: shell

# Override duration value at the command line
cats --config /path/to/config.yaml --location "OX1"
cats --config /path/to/config.y(a)ml --location "OX1"

.. code-block:: shell
When ``--duration`` information is not provided via the option, and
location information is not provided in the YAML configuration file
specified or detected, CATS will try to estimate location from the
machine IP address:

.. code-block:: console

$ cats --duration 480
WARNING:root:config file not found
WARNING:root:Unspecified carbon intensity forecast service, using carbonintensity.org.uk
WARNING:root:location not provided. Estimating location from IP address: RG2.
Best job start time 2024-08-22 07:30:49.800951+01:00
Carbon intensity if job started now = 117.95 gCO2eq/kWh
Carbon intensity at optimal time = 60.93 gCO2eq/kWh

# location information is assumed to be provided in
# ./config.yaml. If not, 'cats' errors out.
cats --duration 480
Use --format=json to get this in machine readable format


Displaying carbon footprint estimates
Expand Down