Skip to content

Commit

Permalink
docs: reform docs and add cocogitto mentions
Browse files Browse the repository at this point in the history
  • Loading branch information
yoctoyotta1024 committed Aug 30, 2024
1 parent 5cce144 commit 510cee1
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 21 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
- uses: actions/checkout@v4
- uses: conda-incubator/setup-miniconda@v3
with:
activate-environment: scienv
activate-environment: goodsciproj_env
environment-file: environment.yml
auto-activate-base: false

Expand All @@ -25,7 +25,7 @@ jobs:
run: |
conda init
source /home/runner/.bashrc
conda activate /usr/share/miniconda/envs/scienv
conda activate /usr/share/miniconda/envs/goodsciproj_env
conda info --envs
- name: Build Pybind11 module for C++ code
Expand All @@ -36,14 +36,14 @@ jobs:
run: pytest ./tests

- name: Install Doxygen
run: /usr/share/miniconda/envs/scienv/bin/doxygen --version
run: /usr/share/miniconda/envs/goodsciproj_env/bin/doxygen --version
shell: bash
- name: Generate Doxygen Documentation
run: |
cd docs &&
mkdir build &&
mkdir build/doxygen &&
/usr/share/miniconda/envs/scienv/bin/doxygen doxygen/doxygen.dox
/usr/share/miniconda/envs/goodsciproj_env/bin/doxygen doxygen/doxygen.dox
shell: bash

- name: Build docs
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
# Template for Good Python and C++ Scientific Project

This code is adapted from [this](https://juliadynamics.github.io/DrWatson.jl/stable) template for
This code is adapted from [this template](https://juliadynamics.github.io/DrWatson.jl/stable) for
Julia Language to make a reproducible scientific project for Python and C++ code in light of the
guidelines from [this](https://www.youtube.com/watch?v=x3swaMSCcYk) Good Scientific Code Workshop by
guidelines from [this Good Scientific Code Workshop](https://www.youtube.com/watch?v=x3swaMSCcYk) by
George Datseris.

## Install
To (locally) reproduce this project simply clone the repository:
```
git clone https://github.com/yoctoyotta1024/GoodSciProjTemplate.git
```
and then create an environment with the necessary dependencies installed (using micromamba, mamba
and then create an environment with the necessary dependencies installed (e.g. using micromamba
or conda as listed in the environment.yml):
```
conda env create -f environment.yml
conda activate scienv
micromamba create -f environment.yml
micromamba activate goodsciproj_env
```
Finally you need to run ``pre-commit install`` but other than that everything should work out of
the box and you can now run & have fun with the project... If not, please raise an issue on the
Expand Down
16 changes: 9 additions & 7 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,18 @@ scientific practises into your GitHub repositories. The template demonstrates:

* what to include in file headers
* how to document your Python and C++ code
* how to make tests for your code (using Python)
* how to make tests for your code (using pytest)
* how to liscence your code
* how to make a citation for your code
* things to include in .gitignore (e.g. large files like jupyter notebooks)
* how to list the requirements of your code (i.e. dependencies) and make a Python environment .yml file
* how to use pre-commit for code formatting (see https://pre-commit.com/)
* how to use continuous integration (CI) to run your tests and publish your documentation on GitHub (see https://docs.github.com/en/actions/automating-builds-and-tests/about-continuous-integration)
* how to write a citation for your code
* things to include in a .gitignore file (e.g. large files like jupyter notebooks)
* how to list the requirements of your code (i.e. dependencies) in an environment YAML file
* how to use pre-commit for code checks, linting and formatting (see https://pre-commit.com/)
* how to use continuous integration (CI) to run pytest and publish documentation on GitHub (see https://docs.github.com/en/actions/automating-builds-and-tests/about-continuous-integration)
* how to write conventional commit messages
* how to use conventional commits and CI for automatic version control on GitHub

To (locally) reproduce this project, simply clone the repository. You will need to setup an
environment with the dependencies installed and then run ``pre-commit install``, but other than
environment with the dependencies installed and then run ``pre-commit install`` but other than
that everything should work out of the box and you can now run & have fun with the project...
If not, please raise an issue on the GitHub repository.

Expand Down
14 changes: 10 additions & 4 deletions docs/source/usage/getstart.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ Clone GoodSciProjTemplate's GitHub repository:
$ git clone https://github.com/yoctoyotta1024/GoodSciProjTemplate.git
and then create an environment with the necessary dependencies installed (using micromamba, mamba
and then create an environment with the necessary dependencies installed (e.g. using micromamba,
or conda as listed in the environment.yml):

.. code-block:: console
$ micromamba env create -f environment.yml
$ micromamba activate scienv
$ micromamba create -f environment.yml
$ micromamba activate goodsciproj_env
Finally install the pre-commit hooks:

Expand All @@ -29,6 +29,9 @@ more about the powers of pre-commit from `their documentation: <https://pre-comm
That's it, you're done! But maybe now you want to customise the project and push it to your own
GitHub repo...

Making the Project Your Own
===========================

Necessary first steps:
###########################

Expand All @@ -46,6 +49,8 @@ Necessary second steps:
#. Corect the repository name and its owner for GitHub (e.g. in the CI.yml and cog.toml).
#. Write a new README.md (shorter is generally better) and include a link to your documentation in it.
#. Change the GitHub links in the .rst files to the correct ones for your GitHub repository (*hint*: you find these files in the `docs` directory).
#. Setup (or delete) cocogitto
#. Setup (or delete) Python bindings for C++

Some suggested third steps:
###########################
Expand All @@ -62,7 +67,8 @@ Want more ideas?!
#################
Have you thought about adding contributors, acknowledgements, more Python and/or
other requirements/enviroments, more CI or pre-commit tasks, and an automatic file header
generator? Maybe you've noticed the repo uses `conventional commit<https://www.conventionalcommits.org/en/v1.0.0/>`_
generator? Maybe you've noticed this repository uses
`conventional commit <https://www.conventionalcommits.org/en/v1.0.0/>`_
messages to enable `cocogitto<https://docs.cocogitto.io/>`_'s automatic version control?
Or maybe you should ponder all this over a cup of tea and some biscuits...

Expand Down
2 changes: 1 addition & 1 deletion environment.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: scienv
name: goodsciproj_env
dependencies:
- python>=3.9
- pytest
Expand Down

0 comments on commit 510cee1

Please sign in to comment.