Skip to content

Repository structure (file layouts, cookiecutter templating engines, distribution options) #1

@agriyakhetarpal

Description

@agriyakhetarpal

Starting this as a placeholder issue for tracking down tasks to be completed and those that are complete. I will be dividing these into separate issues and PRs

Cookiecutters

  1. https://github.com/cookieninja-generator/cookieninja
  2. https://github.com/cookiecutter/cookiecutter

as suggested by @Saransh-cpp

Examples

  1. https://github.com/osl-incubator/scicookie
  2. https://github.com/scientific-python/cookie
  3. https://github.com/copier-org/copier
  4. https://github.com/cruft/cruft/
  5. Cookiecutter Data Science (drivendata.github.io)

Suggestions from @brosaplanella:

  1. "A bit different, but Julia has DrWatson.jl which has many cool features, maybe we can get some ideas".
  2. A figures folder (with a .gitkeep)
  3. A data folder (later we could have some pipelines to process it, like the Data Science example above).

Possible layout

The folder structure can look like this

├── .github/workflows
├── src
├── data
└── docs
      ├── examples  # notebooks that can be rendered with nbsphinx
      ├── _static
      ├── sphinxext
      ├── source
      └── conf.py
├── tests  # (optional)
├── parameters
    └── my_parameters.py  # contains the get_parameter_values() function
├── examples/  # alternatively, example scripts or notebooks that are not to be rendered with the Sphinx builder
├── pyproject.toml
├── README.md
├── .pre-commit-config.yaml
├── .readthedocs.yaml
├── .env # contains DATA_PATH
├── noxfile.py  # (or tox.ini, if users want to use tox)

The required documentation should

  • Explain how to clone this template to start a new project
  • Explain how to rename the project in pyproject.toml and docs/conf.py
  • Explain how to structure a typical project with source files and utility classes and methods (in src/), unit tests with
  • Parameter entry points in pyproject.toml, with
[project.entry-points.pybamm_parameter_sets]
MyParameters = "package_name.parameters.my_parameters:get_parameter_values"
  • Point to the PyBaMM documentation wherein the developments and advancements in this repository shall be reflected on a separate page or section in the user guide

which can then be accessed as pybamm.ParameterValues(“MyParameters”) in the source code.

Tracked in #6.

Configuration options

Build-backends

  1. hatch
  2. flit
  3. poetry
  4. setuptools (later)

Documentation

  1. Theme
  2. Sphinx extensions

Project structure

  1. Project metadata in pyproject.toml
  2. and so on

Available licenses (#2)

  1. MIT
  2. Apache-2.0
  3. BSD-3-Clause
  4. and so on (should be permissive licenses suitable for collaborative research practices and open science)

Addendum 27/02/2024: another thing we would want would be entry points for models in the PyBaMM model structure rather than just parameter sets, please see pybamm-team/PyBaMM#3839 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentationhelp wantedExtra attention is neededinfrastructureIssues that relate to the infrastructure of the repository or the template provided through it

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions