Giter VIP home page Giter VIP logo

greta's People

Contributors

ttitcombe avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

greta's Issues

Setup CI pipeline

Use GitHub pipelines to test code quality (black, isort, mypy) and run unit tests

Cache intensity values

To minimise carbon costs, a codebase should not make unnecessary API calls.

Results from API calls should be cached and subsequent calls should instead use the cached values if an unsufficient amount of time has passed for the carbon intensity to have meaninfully changed. A naive value would be ~10 minutes. Later tasks should focus on making this more intelligent.

Use regional intensity

A user should be able to specify a more specific location within the UK to check carbon intensity.

The carbon intensity APi provides intensity values for regions of the UK. Update the intensity fetching function to take an optional argument denoting region. If present, compare to the regional intensity instead of national.

Skip function based on intensity

Create a decorator which causes a function to skip execution if intensity is higher than a given threshold

This would be a useful feature if an application contained useful but not necessary functionality. For example, regular scraping of a database or API: if intensity is high you could afford to skip that functionality for a while

Unit test code

Create unit tests in PyTest for existing functionality

Reduce "responses" test repetition

We use "responses" library to mock-out API calls. Currently this requires a @responses.active wrapper on every test function and a responses data setup.

Find a way to simplify this for test files so responses code does not need to be written so much

Set behaviour if API call fails

Currently a failed API call will produce unhandled errors. This should be handled by Greta and the user should be able to decide what to do in this scenario. A choice of do/do not run if API call fails.

For this task, treat all failures together (i.e. do not differentiate 4xx and 5xx subtypes). Add a parameter to checks functions to change this behaviour and give it a sensible default (with argument why that should be default behaviour - I've not made up my mind which way!)

Variables conditional on intensity

A variable value should be conditional on the carbon intensity at runtime.
If intensity is below a threshold set one value; set another value if it's above.

This may come in use for code with timeouts or loops. Functions can now run for less time High intensity periods

Log carbon intensity at runtime

As someone trying to develop green software, I want to know the carbon costs of my software running.

Create functions to wrap or otherwise augment logging capability to log the carbon intensity at runtime (start and end).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.