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

release v1 #102

Merged
merged 8 commits into from
Jul 19, 2024
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
6 changes: 2 additions & 4 deletions .github/workflows/docs-build-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,8 @@ jobs:
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
- name: Install cats
run: python3 -m pip install .
- run: |
pip install -r docs/docs-requirements.txt
- name: Install cats with documentation helpers
run: python3 -m pip install '.[docs]'
- name: Build sphinx docs
run: make -C docs html
- name: Deploy sphinx docs
Expand Down
17 changes: 11 additions & 6 deletions cats/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
from .forecast import CarbonIntensityAverageEstimate
from .optimise_starttime import get_avg_estimates # noqa: F401

__version__ = "1.0.0"

# To add a scheduler, add a date format here
# and create a scheduler_<new>(...) function
SCHEDULER_DATE_FORMAT = {"at": "%Y%m%d%H%M"}
Expand All @@ -29,7 +31,9 @@ def parse_arguments():
Parse command line arguments
:return: [dict] parsed arguments
"""
description_text = """
description_text = f"""
Climate-Aware Task Scheduler (version {__version__})
--------------------------------------------------------------------------
The Climate-Aware Task Scheduler (cats) command line program helps you run
your calculations in a way that minimises their impact on the climate by
delaying computation until a time when the ammount of CO2 produced to
Expand Down Expand Up @@ -75,13 +79,14 @@ def parse_arguments():
cats -d 90 --loc OX1 -s at -c 'mycommand'

To report carbon footprint, pass the `--config` option to select a
configuration file and the `--profile` option to select a profile. An
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:

{config_text}
.. code-block:: yaml

The configuration file is documented in the Quickstart section of the online
documentation.
{config_text}
"""

parser = ArgumentParser(
Expand Down Expand Up @@ -226,7 +231,7 @@ def schedule_at(
"""
proc = subprocess.Popen(args, stdout=subprocess.PIPE)
try:
proc_output = subprocess.check_output(
subprocess.check_output(
(
at_command,
"-t",
Expand Down
5 changes: 0 additions & 5 deletions docs/docs-requirements.txt

This file was deleted.

10 changes: 2 additions & 8 deletions docs/source/api-reference.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,10 @@ please see :ref:`cli-reference`.
Modules
-------

``cats.__init__``
``cats``
^^^^^^^^^^^^^^^^^

.. automodule:: cats.__init__
:members:

``cats.__main__``
^^^^^^^^^^^^^^^^^

.. automodule:: cats.__main__
.. automodule:: cats
:members:

``cats.configure``
Expand Down
4 changes: 3 additions & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
import os
import sys

import cats

sys.path.insert(0, os.path.abspath("../..")) # cats repo root directory


Expand All @@ -26,7 +28,7 @@
author = authors
copyright = f"2023, {authors}"
# The full version, including alpha/beta/rc tags
release = "0.1.0"
release = cats.__version__

# Add media: image for logo and a favicon for the browser tab
html_logo = "_static/cats_dalle_img_200x200px_for_logo.png"
Expand Down
6 changes: 6 additions & 0 deletions docs/source/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,10 @@ Install CATS via pip as follows:
.. code-block:: console
:caption: *Command to install CATS with pip.*
$ pip install climate-aware-task-scheduler
sadielbartholomew marked this conversation as resolved.
Show resolved Hide resolved
To install the development version

.. code-block:: console
$ pip install git+https://github.com/GreenScheduler/cats
4 changes: 2 additions & 2 deletions docs/source/quickstart.rst
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ quantity of hardware the job using. This information is provided by
adding a section ``profiles`` to the :ref:`cats YAML configuration
file <configuration-file>`.

You can define an arbitraty number of profiles as subsection of the
You can define an arbitrary number of profiles as subsection of the
top-level ``profiles`` section:

.. literalinclude :: ../../cats/config.yml
Expand Down Expand Up @@ -106,6 +106,6 @@ at the command line:
--profile my_gpu_profile --gpu 4 --cpu 1

.. warning::
The ``--profile`` option is optional. Is not provided, ``cats`` uses the
The ``--profile`` option is optional. If not provided, ``cats`` uses the
first profile defined in the configuration file as the default
profile.
17 changes: 14 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[build-system]
requires = ['setuptools>=40.8.0']
requires = ['setuptools>=61.0.0']
build-backend = 'setuptools.build_meta'

[tool.setuptools]
Expand All @@ -8,7 +8,7 @@

[project]
name = "climate-aware-task-scheduler"
version = "1.0rc1"
dynamic = ["version"]
description = "Climate aware task scheduler"
authors = [
{ name = "Colin Sauze" },
Expand All @@ -25,12 +25,23 @@
license = { file = "LICENSE" }
requires-python = ">=3.9"
readme = "README.md"
classifiers = ["License :: OSI Approved :: MIT License"]
classifiers = [
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3",
"Development Status :: 5 - Production/Stable",
"Environment :: Console",
"Intended Audience :: Science/Research",
"Intended Audience :: System Administrators",
]
dependencies = ["requests-cache>=1.0", "PyYAML>=6.0"]

[tool.setuptools.dynamic]
version = {attr = "cats.__version__"}

[project.optional-dependencies]
test = ["pytest", "numpy>=1.5.0", "pytest-subprocess==1.5.0", "pytest-cov"]
types = ["mypy", "types-PyYAML", "types-redis", "types-requests", "types-ujson"]
docs = ["sphinx", "sphinx-argparse", "ghp-import", "renku-sphinx-theme", "sphinx_copybutton"]

[project.urls]
Home = "https://github.com/GreenScheduler/cats"
Expand Down