Skip to content

Commit

Permalink
Rename from example_project to template_project
Browse files Browse the repository at this point in the history
  • Loading branch information
timmens committed Jun 23, 2024
1 parent 78c6719 commit 5fa308f
Show file tree
Hide file tree
Showing 35 changed files with 85 additions and 79 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ repos:
rev: 0.7.17
hooks:
- id: mdformat
additional_dependencies: [mdformat-gfm, mdformat-black]
additional_dependencies: [mdformat-gfm, mdformat-gfm-alerts, mdformat-black]
args: [--wrap, '88']
files: (README\.md)
- repo: https://github.com/executablebooks/mdformat
Expand Down
10 changes: 5 additions & 5 deletions CITATION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@Unpublished{ExampleProject,
Title = Example Project,
Author = Hans-Martin von Gaudecker,
Year = 2024,
Url = https://github.com/opensourceeconomics/econ-project-templates,
@Unpublished{Gaudecker2024,
Title = "Example Project",
Author = "Hans-Martin von Gaudecker",
Year = "2024",
Url = "https://github.com/opensourceeconomics/econ-project-templates",
}
1 change: 0 additions & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ include LICENSE

exclude *.yaml
exclude *.yml
exclude tox.ini

prune docs
prune tests
36 changes: 0 additions & 36 deletions README-upper.md

This file was deleted.

52 changes: 46 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,61 @@
# Example Project
# Templates for Reproducible Research Projects in Economics

![MIT license](https://img.shields.io/github/license/OpenSourceEconomics/econ-project-templates)
[![image](https://zenodo.org/badge/14557543.svg)](https://zenodo.org/badge/latestdoi/14557543)
[![Documentation Status](https://readthedocs.org/projects/econ-project-templates/badge/?version=stable)](https://econ-project-templates.readthedocs.io/en/stable/)
[![image](https://github.com/OpenSourceEconomics/econ-project-templates/actions/workflows/main.yml/badge.svg)](https://github.com/OpenSourceEconomics/econ-project-templates/actions/workflows/main.yml)
[![image](https://codecov.io/gh/OpenSourceEconomics/econ-project-templates/branch/main/graph/badge.svg)](https://codecov.io/gh/OpenSourceEconomics/econ-project-templates)
[![pre-commit.ci status](https://results.pre-commit.ci/badge/github/OpenSourceEconomics/econ-project-templates/main.svg)](https://results.pre-commit.ci/latest/github/OpenSourceEconomics/econ-project-templates/main)
[![image](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)

This project aims to provide a project template for economists that makes it easy to
produce reproducible research using one or more of the most frequently used programming
languages in economics (i.e Python, R, Julia, Stata).

> [!NOTE]
> While the underlying architecture supports all of the listed programming languages,
> the template project currently only implements a Python and R version.
Users and curious visitors please take a look at the
[documentation](https://econ-project-templates.readthedocs.io/en/stable/).

## Usage

To get started, create and activate the environment with

```console
$ conda/mamba env create
$ conda activate example_project
$ conda activate template_project
```

To build the project, type
To build the template project, type

```console
$ pytask
```

## Credits
### Transferring your own project

Open an editor and look for the template project name `"template_project"`. Replace this
with the name of your project.

You can now add new files to the project and remove the template files.

## Contributing

We welcome suggestions on anything: improving the documentation, bug reports, feature
requests. Please open an
[issue](https://github.com/OpenSourceEconomics/econ-project-templates/issues) in these
cases.

If you want to work on a specific feature, we are more than happy to get you started!
Please [get in touch briefly](https://www.wiwi.uni-bonn.de/gaudecker), this is a small
team so there is no need for a detailed formal process.

### Contributors

@hmgaudecker @timmens @tobiasraabe @mj023

### Former Contributors

This project was created using the
[econ-project-templates](https://github.com/OpenSourceEconomics/econ-project-templates).
@janosg @PKEuS @philippmuller @julienschat @raholler
4 changes: 2 additions & 2 deletions docs/source/development/how-to-contribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ for some immediate and clearly defined tasks.
## Working on the inner project

We differentiate between the *inner project*, which is the example project located in
example_project, and the *outer project*, which is everything else.
template_project, and the *outer project*, which is everything else.

To work on the inner project we recommend the following workflow:

Expand All @@ -90,4 +90,4 @@ To work on the inner project we recommend the following workflow:
1. Repeat step 3

1. Transfer changes to the official repository by changing example names to
example_project etc.
template_project etc.
2 changes: 1 addition & 1 deletion environment.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
name: example_project
name: template_project
channels: [conda-forge, r, nodefaults]
dependencies:
- r-plyr
Expand Down
4 changes: 2 additions & 2 deletions paper/task_paper.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
import shutil

import pytask
from example_project.config import BLD, PAPER_DIR
from pytask_latex import compilation_steps as cs
from template_project.config import BLD, PAPER_DIR

Check warning on line 7 in paper/task_paper.py

View check run for this annotation

Codecov / codecov/patch

paper/task_paper.py#L7

Added line #L7 was not covered by tests

documents = ["example_project", "example_project_pres"]
documents = ["template_project", "template_project_pres"]

Check warning on line 9 in paper/task_paper.py

View check run for this annotation

Codecov / codecov/patch

paper/task_paper.py#L9

Added line #L9 was not covered by tests

for document in documents:

Expand Down
File renamed without changes.
File renamed without changes.
15 changes: 9 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,32 @@
requires = ["setuptools>=45", "wheel", "setuptools_scm[toml]>=6.0"]

[tool.setuptools_scm]
write_to = "src/example_project/_version.py"
write_to = "src/template_project/_version.py"

[tool.pytask.ini_options]
paths = ["./src/example_project", "./paper"]
paths = ["./src/template_project", "./paper"]
pdbcls = "pdbp:Pdb"

[tool.ruff]
target-version = "py311"
select = ["ALL"]
target-version = "py312"
fix = true


[tool.ruff.lint]
select = ["ALL"]
extend-ignore = [
"S101", # Use of `assert` detected.
"ANN", # Missing type annotations
"D100", # Missing docstring in public module
"D104", # Missing docstring in public package (__init__.py files)
]

[tool.ruff.per-file-ignores]
[tool.ruff.lint.per-file-ignores]
"tests/*" = ["D", "PD011"]
"task_*.py" = ["ANN", "ARG001"]
"docs/**/task_*.py" = ["D103", "S603"]

[tool.ruff.pydocstyle]
[tool.ruff.lint.pydocstyle]
convention = "google"


Expand Down
6 changes: 3 additions & 3 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[metadata]
name = example_project
name = template_project
description = Example project
long_description = file: README-upper.md
long_description = file: README.md
long_description_content_type = text/markdown
url = https://github.com/OpenSourceEconomics/econ-project-templates
author = Hans-Martin von Gaudecker
Expand Down Expand Up @@ -38,4 +38,4 @@ where = src

[check-manifest]
ignore =
src/example_project/_version.py
src/template_project/_version.py
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
import pandas as pd
import pytask

from example_project.analysis.model import fit_logit_model, load_model
from example_project.analysis.predict import predict_prob_by_age
from example_project.config import BLD, GROUPS, SRC
from example_project.utilities import read_yaml
from template_project.analysis.model import fit_logit_model, load_model
from template_project.analysis.predict import predict_prob_by_age
from template_project.config import BLD, GROUPS, SRC
from template_project.utilities import read_yaml


def task_fit_model_python(
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
import pandas as pd
import pytask

from example_project.config import BLD, SRC
from example_project.data_management.clean_data import clean_data
from example_project.utilities import read_yaml
from template_project.config import BLD, SRC
from template_project.data_management.clean_data import clean_data
from template_project.utilities import read_yaml


def task_clean_data_python(
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
import pandas as pd
import pytask

from example_project.analysis.model import load_model
from example_project.config import BLD, GROUPS, SRC
from example_project.final.plot import plot_regression_by_age
from example_project.utilities import read_yaml
from template_project.analysis.model import load_model
from template_project.config import BLD, GROUPS, SRC
from template_project.final.plot import plot_regression_by_age
from template_project.utilities import read_yaml

for group in GROUPS:
deps = {
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion tests/analysis/test_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import numpy as np
import pandas as pd
import pytest
from example_project.analysis.model import fit_logit_model
from template_project.analysis.model import fit_logit_model

DESIRED_PRECISION = 10e-2

Expand Down
2 changes: 1 addition & 1 deletion tests/analysis/test_predict.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

import pandas as pd
import pytest
from example_project.analysis.predict import predict_prob_by_age
from pandas.testing import assert_frame_equal
from template_project.analysis.predict import predict_prob_by_age


@pytest.fixture()
Expand Down
6 changes: 3 additions & 3 deletions tests/data_management/test_clean_data.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import numpy as np
import pandas as pd
import pytest
from example_project.config import TEST_DIR
from example_project.data_management.clean_data import clean_data
from example_project.utilities import read_yaml
from template_project.config import TEST_DIR
from template_project.data_management.clean_data import clean_data
from template_project.utilities import read_yaml


@pytest.fixture()
Expand Down

0 comments on commit 5fa308f

Please sign in to comment.