Skip to content

Commit

Permalink
Merge pull request #111 from sadielbartholomew/minor-updates
Browse files Browse the repository at this point in the history
Update and clarify aspects in documentation
  • Loading branch information
sadielbartholomew authored Aug 27, 2024
2 parents fa1a8cc + 715d4cb commit 34c951e
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 11 deletions.
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

0 comments on commit 34c951e

Please sign in to comment.