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

Changed project name pybamm-cookiecutter -> pybamm-cookie #46

Merged
merged 3 commits into from
Aug 15, 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
8 changes: 4 additions & 4 deletions .github/workflows/test_on_push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
name:
Template Generation/Project Tests (${{ matrix.os }} / Python ${{ matrix.python-version }})
steps:
- name: Checkout pybamm-cookiecutter
- name: Checkout pybamm-cookie
uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
Expand Down Expand Up @@ -79,7 +79,7 @@ jobs:
name: Doctests (ubuntu-latest / Python 3.12)

steps:
- name: Check out pybamm-cookiecutter repository
- name: Check out pybamm-cookie repository
uses: actions/checkout@v4
with:
fetch-depth: 0
Expand Down Expand Up @@ -114,7 +114,7 @@ jobs:
name: Generated Project Tests (${{ matrix.os }} / Python ${{ matrix.python-version }} / Backend ${{ matrix.backend }} / VCS ${{ matrix.vcs }})

steps:
- name: Checkout pybamm-cookiecutter
- name: Checkout pybamm-cookie
uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
Expand Down Expand Up @@ -146,7 +146,7 @@ jobs:
name: Generated Project Doctests (ubuntu-latest / Python 3.12)

steps:
- name: Check out pybamm-cookiecutter repository
- name: Check out pybamm-cookie repository
uses: actions/checkout@v4
with:
fetch-depth: 0
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ cython_debug/
.vscode/

# hatch-vcs
src/pybamm_cookiecutter/_version.py
src/pybamm_cookie/_version.py

# ruff
.ruff_cache/
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ repos:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
files: "^(src/pybamm_cookiecutter|tests$)"
files: "^(src/pybamm_cookie|tests$)"
- id: check-added-large-files
- id: mixed-line-ending

Expand All @@ -38,7 +38,7 @@ repos:
rev: v0.5.7
hooks:
- id: ruff
files: "^(src/pybamm_cookiecutter|tests$)"
files: "^(src/pybamm_cookie|tests$)"
args: ["--fix", "--show-fixes"]

# Documentation files
Expand All @@ -62,7 +62,7 @@ repos:
rev: v1.11.1
hooks:
- id: mypy
files: "^(src/pybamm_cookiecutter|tests$)"
files: "^(src/pybamm_cookie|tests$)"

exclude:
CODE-OF-CONDUCT.md
2 changes: 1 addition & 1 deletion CODE-OF-CONDUCT.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-2.1-4baaaa.svg)](CODE-OF-CONDUCT.md)


# `pybamm-cookiecutter` Code of Conduct
# `pybamm-cookie` Code of Conduct

## Our Pledge

Expand Down
30 changes: 15 additions & 15 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Contributing to `pybamm-cookiecutter`
# Contributing to `pybamm-cookie`

If you'd like to contribute to this project, please have a look at the [guidelines below](#workflow).

Expand All @@ -13,7 +13,7 @@ Before you commit any code, please perform the following checks:

### Installing and using pre-commit

`pybamm-cookiecutter` uses a set of `pre-commit` hooks and the `pre-commit` bot to format and prettify the codebase. The hooks can be installed locally using -
`pybamm-cookie` uses a set of `pre-commit` hooks and the `pre-commit` bot to format and prettify the codebase. The hooks can be installed locally using -

```bash
pip install pre-commit
Expand All @@ -37,25 +37,25 @@ We use [Git](https://en.wikipedia.org/wiki/Git) and [GitHub](https://en.wikipedi
1. Create an [issue](https://guides.github.com/features/issues/) where new proposals can be discussed before any coding is done.
2. Create a [branch](https://help.github.com/articles/creating-and-deleting-branches-within-your-repository/) of this repo (ideally on your own [fork](https://help.github.com/articles/fork-a-repo/)), where all changes will be made.
3. Download the source code onto your local system, by [cloning](https://help.github.com/articles/cloning-a-repository/) the repository (or your fork of the repository).
4. Use `nox -s dev` or `pip install -e .[dev]` to install `pybamm-cookiecutter` in editable/development mode.
4. Use `nox -s dev` or `pip install -e .[dev]` to install `pybamm-cookie` in editable/development mode.
5. [Test](#testing) if your installation worked, using the test script: `nox -s test-generation` or `pytest`.

You now have everything you need to start making changes!

### B. Writing your code

6. This project is developed in [Python](https://www.python.org)), and uses the [cookiecutter](https://cookiecutter.readthedocs.io/en/stable/) templating tool. For testing, we use [`pytest`](https://docs.pytest.org/en/).
6. This project is developed in [Python](https://www.python.org)), and uses the [copier](https://copier.readthedocs.io/) templating tool. For testing, we use [`pytest`](https://docs.pytest.org/en/).
7. Make sure to follow our [coding style guidelines](#coding-style-guidelines).
8. Commit your changes to your branch with [useful, descriptive commit messages](https://chris.beams.io/posts/git-commit/): Remember these are
publicly visible and should still make sense a few months ahead in time.
While developing, you can keep using the GitHub issue you're working on
as a place for discussion.

### C. Merging your changes with `pybamm-cookiecutter`
### C. Merging your changes with `pybamm-cookie`

9. [Test your code!](#testing)
10. When you feel your code is finished, or at least warrants serious discussion, run the [pre-commit checks](#pre-commit-checks) and then create a [pull request](https://help.github.com/articles/about-pull-requests/) (PR) on [`pybamm-cookiecutter`'s GitHub page](https://github.com/pybamm-team/pybamm-cookiecutter).
11. Once a PR has been created, it will be reviewed by any member of the community. Changes might be suggested which you can make by simply adding new commits to the branch. When everything's finished, someone with the right GitHub permissions will merge your changes into pybamm-cookiecutter main repository.
10. When you feel your code is finished, or at least warrants serious discussion, run the [pre-commit checks](#pre-commit-checks) and then create a [pull request](https://help.github.com/articles/about-pull-requests/) (PR) on [`pybamm-cookie`'s GitHub page](https://github.com/pybamm-team/pybamm-cookie).
11. Once a PR has been created, it will be reviewed by any member of the community. Changes might be suggested which you can make by simply adding new commits to the branch. When everything's finished, someone with the right GitHub permissions will merge your changes into pybamm-cookie main repository.


## Coding style guidelines
Expand All @@ -64,14 +64,14 @@ This project follows the [PEP8 recommendations](https://www.python.org/dev/peps/

### Ruff

We use [ruff](https://github.com/charliermarsh/ruff) to check our PEP8 adherence. To try this on your system, navigate to the parent pybamm-cookiecutter directory in a console and type
We use [ruff](https://github.com/astral-sh/ruff) to check our PEP8 adherence. To try this on your system, navigate to the parent pybamm-cookie directory in a console and type

```bash
python -m pip install pre-commit
pre-commit run ruff
```

Ruff is configured inside the file `pre-commit-config.yaml`, allowing us to ignore some errors. If you think some rules should be added or removed, please submit an [issue](https://github.com/pybamm-team/pybamm-cookiecutter/issues).
Ruff is configured inside the file `pre-commit-config.yaml`, allowing us to ignore some errors. If you think some rules should be added or removed, please submit an [issue](https://github.com/pybamm-team/pybamm-cookie/issues).

If you performed the `pre-commit install` step above, your code changes will be checked against Ruff automatically when you try to commit them (see [Pre-commit checks](#pre-commit-checks)).

Expand Down Expand Up @@ -109,7 +109,7 @@ Using [Sphinx](http://www.sphinx-doc.org/en/stable/) the documentation in `docs`

### Building the documentation

To test and debug the documentation, it's best to build it locally. To do this, navigate to your pybamm-cookiecutter directory in a console, and then type:
To test and debug the documentation, it's best to build it locally. To do this, navigate to your pybamm-cookie directory in a console, and then type:

```
nox -s docs
Expand All @@ -119,9 +119,9 @@ And then visit the webpage served at `http://127.0.0.1:8000`. Each time a change

### Continuous Integration using GitHub Actions

Each change pushed to the `pybamm-cookiecutter` GitHub repository will trigger the tests to be run, using [GitHub Actions](https://github.com/features/actions).
Each change pushed to the `pybamm-cookie` GitHub repository will trigger the tests to be run, using [GitHub Actions](https://github.com/features/actions).

Tests are run for different operating systems, and for all Python versions officially supported by the `pybamm-cookiecutter` template. If you open a pull request (PR), feedback is directly available on the corresponding page. If all tests pass, a green tick will be displayed next to the corresponding test run. If one or more test(s) fail, a red cross will be displayed instead.
Tests are run for different operating systems, and for all Python versions officially supported by the `pybamm-cookie` template. If you open a pull request (PR), feedback is directly available on the corresponding page. If all tests pass, a green tick will be displayed next to the corresponding test run. If one or more test(s) fail, a red cross will be displayed instead.

More details can be obtained by clicking on a specific run.

Expand All @@ -131,6 +131,6 @@ Configuration files for various GitHub Actions workflows can be found in `.githu

GitHub does some magic with particular filenames. In particular:

- The first page people see when they go to [our GitHub page](https://github.com/pybamm-team/pybamm-cookiecutter) displays the contents of [README.md](https://github.com/pybamm-team/pybamm-cookiecutter/blob/main/README.md), which is written in the [Markdown](https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet) format. Some guidelines can be found [here](https://help.github.com/articles/about-readmes/).
- The license for using pybamm-cookiecutter is stored in [LICENSE](https://github.com/pybamm-team/pybamm-cookiecutter/blob/main/LICENSE.txt), and [automatically](https://help.github.com/articles/adding-a-license-to-a-repository/) linked to by GitHub.
- This file, [CONTRIBUTING.md](https://github.com/pybamm-team/pybamm-cookiecutter/blob/main/CONTRIBUTING.md) is recognised as the document that lists the contribution guidelines and a link is [automatically](https://github.com/blog/1184-contributing-guidelines) displayed when new issues or pull requests are created.
- The first page people see when they go to [our GitHub page](https://github.com/pybamm-team/pybamm-cookie) displays the contents of [README.md](https://github.com/pybamm-team/pybamm-cookie/blob/main/README.md), which is written in the [Markdown](https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet) format. Some guidelines can be found [here](https://help.github.com/articles/about-readmes/).
- The license for using pybamm-cookie is stored in [LICENSE](https://github.com/pybamm-team/pybamm-cookie/blob/main/LICENSE.txt), and [automatically](https://help.github.com/articles/adding-a-license-to-a-repository/) linked to by GitHub.
- This file, [CONTRIBUTING.md](https://github.com/pybamm-team/pybamm-cookie/blob/main/CONTRIBUTING.md) is recognised as the document that lists the contribution guidelines and a link is [automatically](https://github.com/blog/1184-contributing-guidelines) displayed when new issues or pull requests are created.
54 changes: 27 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# pybamm-cookiecutter
# pybamm-cookie

<!-- TODO: configure badges -->

Expand All @@ -11,57 +11,57 @@

[![GitHub Discussions][github-discussions-badge]][github-discussions-link]

[actions-badge]: https://github.com/pybamm-team/pybamm-cookiecutter/workflows/CI/badge.svg
[actions-link]: https://github.com/pybamm-team/pybamm-cookiecutter/actions
[conda-badge]: https://img.shields.io/conda/vn/conda-forge/pybamm-cookiecutter
[conda-link]: https://github.com/conda-forge/pybamm-cookiecutter-feedstock
[actions-badge]: https://github.com/pybamm-team/pybamm-cookie/workflows/CI/badge.svg
[actions-link]: https://github.com/pybamm-team/pybamm-cookie/actions
[conda-badge]: https://img.shields.io/conda/vn/conda-forge/pybamm-cookie
[conda-link]: https://github.com/conda-forge/pybamm-cookie-feedstock
[github-discussions-badge]: https://img.shields.io/static/v1?label=Discussions&message=Ask&color=blue&logo=github
[github-discussions-link]: https://github.com/pybamm-team/pybamm-cookiecutter/discussions
[pypi-link]: https://pypi.org/project/pybamm-cookiecutter/
[pypi-platforms]: https://img.shields.io/pypi/pyversions/pybamm-cookiecutter
[pypi-version]: https://img.shields.io/pypi/v/pybamm-cookiecutter
[rtd-badge]: https://readthedocs.org/projects/pybamm-cookiecutter/badge/?version=latest
[rtd-link]: https://pybamm-cookiecutter.readthedocs.io/en/latest/?badge=latest -->
[github-discussions-link]: https://github.com/pybamm-team/pybamm-cookie/discussions
[pypi-link]: https://pypi.org/project/pybamm-cookie/
[pypi-platforms]: https://img.shields.io/pypi/pyversions/pybamm-cookie
[pypi-version]: https://img.shields.io/pypi/v/pybamm-cookie
[rtd-badge]: https://readthedocs.org/projects/pybamm-cookie/badge/?version=latest
[rtd-link]: https://pybamm-cookie.readthedocs.io/en/latest/?badge=latest -->

<!-- SPHINX-START -->
[![Powered by NumFOCUS](https://img.shields.io/badge/powered%20by-NumFOCUS-orange.svg?style=flat&colorA=E1523D&colorB=007D8A)](http://numfocus.org)
[![Copier](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/copier-org/copier/master/img/badge/badge-grayscale-inverted-border-red.json)](https://github.com/copier-org/copier)
[![Test template and generated project](https://github.com/pybamm-team/pybamm-cookie/actions/workflows/test_on_push.yml/badge.svg)](https://github.com/pybamm-team/pybamm-cookie/actions/workflows/test_on_push.yml)

This repository contains a `copier` template for battery modeling projects using PyBaMM, released under the [BSD-3-Clause license](https://github.com/pybamm-team/pybamm-cookiecutter/blob/main/LICENSE). Currently under active development.
This repository contains a `copier` template for battery modeling projects using PyBaMM, released under the [BSD-3-Clause license](https://github.com/pybamm-team/pybamm-cookie/blob/main/LICENSE). Currently under active development.

## 📄 Using `pybamm-cookiecutter`
## 📄 Using `pybamm-cookie`

### Generating projects with `pybamm-cookiecutter`
### Generating projects with `pybamm-cookie`

#### Manually using copier

Install `copier` and `jinja2_time` extension using `pip`.
```bash
pip install copier jinja2-time
```
Generate a project from the `pybamm-cookiecutter` template.
Generate a project from the `pybamm-cookie` template.

```bash
copier copy https://github.com/pybamm-team/pybamm-cookiecutter.git . --trust
copier copy https://github.com/pybamm-team/pybamm-cookie.git . --trust
# this will generate the project in the current working directory
copier copy https://github.com/pybamm-team/pybamm-cookiecutter.git path_to_copy_to/ --trust
copier copy https://github.com/pybamm-team/pybamm-cookie.git path_to_copy_to/ --trust
# this will generate the project in the specified path
```
#### Using pipx (recommended)

You can generate a project by executing the `pipx run` command which doesn't need any package installations.
```bash
pipx run pybamm-cookiecutter --path /path_to_copy_to
pipx run pybamm-cookie --path /path_to_copy_to
```

Or if you wish to install the `pybamm-cookiecutter` package and then generate a project, you could do so with the help of following commands.
Or if you wish to install the `pybamm-cookie` package and then generate a project, you could do so with the help of following commands.
```bash
pipx install pybamm-cookiecutter # or pip install pybamm-cookiecutter
pipx install pybamm-cookie # or pip install pybamm-cookie
```
Navigate into the directory you want your project directory to reside in, or use `--path` argument to explicitly mention the path where you want your project to be generated.
```bash
pybamm-cookiecutter --path /path_to_copy_to
pybamm-cookie --path /path_to_copy_to
```

Copier will prompt you with various configurations and you may choose the ones that suit your use case.
Expand All @@ -70,7 +70,7 @@ Copier will prompt you with various configurations and you may choose the ones t

After generation, you can navigate to the generated project and run `nox -s generated-project-tests` to ensure if the project units are working as intended.

### Installing the `pybamm-cookiecutter` project
### Installing the `pybamm-cookie` project

This refers to the project used for the development of this template. There are two ways to install this project: either through `nox` or `pip`. `nox` uses `uv pip` or `pip` internally, and in this case, creates a virtual environment for you to activate.
To install, navigate to the root directory of this repository and execute either of these commands:
Expand All @@ -82,14 +82,14 @@ or
To check if the project was successfully installed, import the project inside Python.

```python
import pybamm_cookiecutter
import pybamm_cookie

pybamm_cookiecutter.__version__
pybamm_cookie.__version__
```

## 🛠️ Contributing to `pybamm-cookiecutter`
## 🛠️ Contributing to `pybamm-cookie`

If you'd like to help us develop `pybamm-cookiecutter` by improving the template's features, writing documentation, or fixing embarrassing bugs, please have a look at these [guidelines](https://github.com/pybamm-team/pybamm-cookiecutter/blob/main/CONTRIBUTING.md).
If you'd like to help us develop `pybamm-cookie` by improving the template's features, writing documentation, or fixing embarrassing bugs, please have a look at these [guidelines](https://github.com/pybamm-team/pybamm-cookie/blob/main/CONTRIBUTING.md).

## 📫 Get in touch

Expand All @@ -98,6 +98,6 @@ For any questions, comments, suggestions or bug reports, please see the

## 📃 License

The `pybamm-cookiecutter` project is open source code. For more information about its license, see [LICENSE](https://github.com/pybamm-team/pybamm-cookiecutter/blob/main/LICENSE).
The `pybamm-cookie` project is open source code. For more information about its license, see [LICENSE](https://github.com/pybamm-team/pybamm-cookie/blob/main/LICENSE).

<!-- SPHINX-END -->
4 changes: 2 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import importlib.metadata

project = "pybamm-cookiecutter"
project = "pybamm-cookie"
copyright = "2018-2023, The PyBaMM Team"
author = "Agriya Khetarpal"
version = release = importlib.metadata.version("pybamm_cookiecutter")
version = release = importlib.metadata.version("pybamm_cookie")

extensions = [
"myst_parser",
Expand Down
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# pybamm-cookiecutter
# pybamm-cookie

```{toctree}
:maxdepth: 2
Expand Down
4 changes: 2 additions & 2 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,11 @@ def run_coverage(session):
session.install("setuptools", silent=False)
session.install("coverage", silent=False)
session.install("-e", ".[dev]", silent=False)
session.run("pytest", "--cov=src/pybamm_cookiecutter", "--cov-report=xml", "tests/")
session.run("pytest", "--cov=src/pybamm_cookie", "--cov-report=xml", "tests/")

@nox.session(name="dev")
def set_dev(session):
"""Install pybamm-cookiecutter in editable mode"""
"""Install pybamm-cookie in editable mode"""
session.install("virtualenv")
session.run("virtualenv", os.fsdecode(VENV_DIR), silent=True)
python = os.fsdecode(VENV_DIR.joinpath("bin/python"))
Expand Down
Loading
Loading