{"id":30635433,"url":"https://github.com/giscience/climate-action-ghg-budget","last_synced_at":"2025-08-30T22:36:21.582Z","repository":{"id":308514096,"uuid":"1030522176","full_name":"GIScience/climate-action-ghg-budget","owner":"GIScience","description":"Read-only GitHub mirror of https://gitlab.heigit.org/climate-action/plugins/ghg-budget","archived":false,"fork":false,"pushed_at":"2025-08-29T13:47:14.000Z","size":1721,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-08-29T16:40:39.933Z","etag":null,"topics":["climate-action"],"latest_commit_sha":null,"homepage":"https://climate-action.heigit.org","language":"Python","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/GIScience.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-08-01T19:35:31.000Z","updated_at":"2025-08-29T13:47:17.000Z","dependencies_parsed_at":"2025-08-06T11:28:43.699Z","dependency_job_id":"4980cbd3-6463-4f58-8fe6-2f99bff95f0f","html_url":"https://github.com/GIScience/climate-action-ghg-budget","commit_stats":null,"previous_names":["giscience/climate-action-ghg-budget"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/GIScience/climate-action-ghg-budget","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GIScience%2Fclimate-action-ghg-budget","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GIScience%2Fclimate-action-ghg-budget/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GIScience%2Fclimate-action-ghg-budget/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GIScience%2Fclimate-action-ghg-budget/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GIScience","download_url":"https://codeload.github.com/GIScience/climate-action-ghg-budget/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GIScience%2Fclimate-action-ghg-budget/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272917688,"owners_count":25014933,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-30T02:00:09.474Z","response_time":77,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["climate-action"],"created_at":"2025-08-30T22:36:20.564Z","updated_at":"2025-08-30T22:36:21.574Z","avatar_url":"https://github.com/GIScience.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# \u003cimg src=\"resources/info/icon.jpg\" width=\"5%\"\u003e GHG Budget\n\nThe GHG Budget Tool calculates the CO₂ budget for the selected city or municipality that may be emitted in order to achieve the climate targets that were agreed at the COP 21 in Paris at the end of 2015.\nThe tool is currently limited to the following cities: Berlin, Bonn, Heidelberg, Karlsruhe.\nHowever, it is to be extended to other cities in the future.\n\n## Preparation\n\nUse git to clone this repository to your computer.\nCreate a new branch by running git checkout -b \u003cmy_new_branch_name\u003e.\nAfter you have finished your implementation, you can create a merge request to the main branch that can be reviewed by the CA team.\nWe highly encourage you to create smaller intermediate MRs for review!\n\n### Python Environment\n\nWe use [poetry](https://python-poetry.org) as an environment management system.\nMake sure you have it installed.\nApart from some base dependencies, there is only one fixed dependency for you, which is the [climatoology](https://gitlab.gistools.geog.uni-heidelberg.de/climate-action/climatoology) package that holds all the infrastructure functionality.\nMake sure you have read-access to the climatoology repository (i.e. you can clone it).\n\nNow run\n\n```shell\npoetry install --with dev,test\n```\n\nand you are ready to code within your poetry environment.\n\n### Testing\n\nWe use [pytest](pytest.org) as testing engine.\nEnsure all tests are passing on the unmodified repository by running `poetry run pytest`.\n\n#### Coverage\n\nTo get a coverage report of how much of your code is run during testing, execute\n`poetry run pytest --ignore test/core/ --cov`.\nWe ignore the `test/core/` folder when assessing coverage because the core tests run the whole plugin to be sure\neverything successfully runs with a very basic configuration.\nYet, they don't actually test functionality and therefore artificially inflate the test coverage results.\n\nTo get a more detailed report including which lines in each file are **not** tested,\nrun `poetry run pytest --ignore test/core/ --cov --cov-report term-missing`\n\n### Linting and formatting\n\nIt is important that the code created by the different plugin developers adheres to a certain standard.\nWe use [ruff](https://docs.astral.sh/ruff/) for linting and formatting the code as part of our pre-commit hooks.\nPlease activate pre-commit by running `poetry run pre-commit install`.\nIt will now run automatically before each commit and apply fixes for a variety of lint errors to your code.\nNote that we have increased the maximum number of characters per line to be 120 to make better use of large modern displays.\nIf you want to keep short lines explicitly seperate (e.g. in the definition of functions or list) please use [\"magic trailing commas\"](https://docs.astral.sh/ruff/settings/#format_skip-magic-trailing-comma).\n\n### Logging\n\nUsing the environment variable `LOG_Level` you can adjust the amount of log messages produced by the plugin.\nPlease make sure to use logging throughout your plugin.\nThis will make debugging easier at a later stage.\n\n## Releasing a new plugin version\n\nTo release a new plugin version\n\n1. update the version attribute in the [pyproject.toml](pyproject.toml) (e.g. by running `poetry version {patch|minor|major}`)\n2. update the version in the plugin `info` method\n3. create a [release](https://docs.gitlab.com/ee/user/project/releases/) on GitLab, preferably including a changelog\n\nPlease adhere to the [Semantic Versioning](https://semver.org/) scheme.\nYou can think of the plugin methods (info method, input parameters and artifacts) as the public API of your plugin.\n\n## Docker\n\nTo build docker images, you need to give the engine access to the climatoology repository.\nCreate a file `CI_JOB_TOKEN` that contains your personal access token to the climatoology repository.\n\n### Build\n\nThe tool is also [Dockerised](Dockerfile).\nImages are automatically built and deployed in the [CI-pipeline](.gitlab-ci.yml).\n\nIn case you want to manually build and run locally (e.g. to test a new feature in development), execute\n\n\n```shell\ndocker build --secret id=CI_JOB_TOKEN . --tag repo.heigit.org/climate-action/ghg-budget:devel\n```\n\nNote that this will overwrite any existing image with the same tag (i.e. the one you previously pulled from the Climate\nAction docker registry).\n\nTo mimic the build behaviour of the CI you have to add `--build-arg CI_COMMIT_SHORT_SHA=$(git rev-parse --short HEAD)`\nto the above command.\n\n### Run\n\nIf you have the Climate Infrastructure running (see [Development Setup](#development-setup)) you can now run the\ncontainer via\n\n```shell\ndocker run --rm --network=host --env-file .env.base --env-file .env repo.heigit.org/climate-action/ghg-budget:devel\n```\n\n### Deploy\n\nDeployment is handled by the GitLab CI automatically.\nIf for any reason you want to deploy manually (and have the required rights), after building the image, run\n\n```shell\ndocker image push repo.heigit.org/climate-action/ghg-budget:devel\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgiscience%2Fclimate-action-ghg-budget","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgiscience%2Fclimate-action-ghg-budget","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgiscience%2Fclimate-action-ghg-budget/lists"}