Skip to content

Commit

Permalink
Add: Updating folder structure
Browse files Browse the repository at this point in the history
* fix: remove data sub folders and update env variables

* fix: remove unnecessary root folders and update environment variables

* fix: rearrange package and src and update env variables

* fix: fix test env variable

* fix: update setup files for install

* fix: add example test to env variables

* Revert "fix: add example test to env variables"

This reverts commit eb30663.

* Revert "fix: update setup files for install"

This reverts commit 1021857.

* Revert "fix: fix test env variable"

This reverts commit 27745ee.

* Revert "fix: rearrange package and src and update env variables"

This reverts commit 7124468.

* fix: move test folder and change test env variable

* fix: remove module folders from package and update env variables

* fix: swap src and package folders around and update env variables

* fix: remove utils folder env variable

* docs: remove structure documentation

* fix: update injected variables for structure docs removal

* docs: remove reference docs for package

* fix: update injected variables for reference folder removal

* fix: update repo name count in injected variables

* docs: update docs to reflect the removed folders

* fix: remove autosummary code blocks in writing sphinx docs

* fix: updated package location for pip install

* fix: update repo injected variables

* fix: fix directory for setup.cfg

* fix: update injected variable counts
  • Loading branch information
joshlynchONS authored Mar 6, 2023
1 parent ef7990d commit 79dfe60
Show file tree
Hide file tree
Showing 36 changed files with 19 additions and 429 deletions.
16 changes: 8 additions & 8 deletions tests/test_govcookiecutter_injected_variables.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
}
ORGANISATION_HANDLE_COUNT = {
'"{{ cookiecutter.organisation_handle }}"': 1,
"`{{ cookiecutter.organisation_handle }}`": 4,
"`{{ cookiecutter.organisation_handle }}`": 3,
'u"{{ cookiecutter.organisation_handle }}",': 0,
'[u"{{ cookiecutter.organisation_handle }}"],': 0,
'"{{ cookiecutter.organisation_handle }}",': 0,
Expand All @@ -30,11 +30,11 @@
}
REPO_NAME_COUNT = {
'"{{ cookiecutter.repo_name }}",': 0,
"`{{ cookiecutter.repo_name }}`": 15,
"`{{ cookiecutter.repo_name }}`": 8,
"`{{ cookiecutter.repo_name }}`,": 1,
'"{{ cookiecutter.repo_name }}.tex",': 0,
'"{{ cookiecutter.repo_name }}doc"': 1,
"{{ cookiecutter.repo_name }}": 10,
"{{ cookiecutter.repo_name }}": 4,
}
OVERVIEW_COUNT = {
'"{{ cookiecutter.overview }}",': 0,
Expand All @@ -53,10 +53,10 @@
}
USING_R_YES_COUNT = {
"https://github.com/lorenzwalthert/precommit": 2,
"`.lintr`": 1,
"`.Rprofile`": 1,
"`DESCRIPTION`": 2,
"`startup.R`": 1,
"`.lintr`": 0,
"`.Rprofile`": 0,
"`DESCRIPTION`": 0,
"`startup.R`": 0,
}


Expand Down Expand Up @@ -165,7 +165,7 @@ def recursive_open_and_count_search_terms(
(
"repo_name",
"repo_2",
{**REPO_NAME_COUNT, "{{ cookiecutter.repo_name }}": 11},
{**REPO_NAME_COUNT, "{{ cookiecutter.repo_name }}": 5},
{"using_R": "Yes"},
),
("overview", "overview_1", OVERVIEW_COUNT, {"using_R": "No"}),
Expand Down
21 changes: 3 additions & 18 deletions {{ cookiecutter.repo_name }}/.env
Original file line number Diff line number Diff line change
Expand Up @@ -24,30 +24,15 @@

# Add environment variables for the `data` directories
DIR_DATA=./data
DIR_DATA_EXTERNAL=./data/external
DIR_DATA_RAW=./data/raw
DIR_DATA_INTERIM=./data/interim
DIR_DATA_PROCESSED=./data/processed

# Add environment variables for the `docs` directory
DIR_DOCS=./docs

# Add environment variables for the `notebooks` directory
DIR_NOTEBOOKS=./notebooks

# Add environment variables for the `outputs` directory
DIR_OUTPUTS=./outputs

# Add environment variable for package directory
DIR_COOKIECUTTER.REPO_NAME = ./{{ cookiecutter.repo_name }}
DIR_SRC = ./src

# Add environment variables for the `src` directories
DIR_COOKIECUTTER.REPO_NAME_SRC=./{{ cookiecutter.repo_name }}/src
DIR_SRC_MAKE_DATA=./{{ cookiecutter.repo_name }}/src/make_data
DIR_SRC_MAKE_FEATURES=./{{ cookiecutter.repo_name }}/src/make_features
DIR_SRC_MAKE_MODELS=./{{ cookiecutter.repo_name }}/src/make_models
DIR_SRC_MAKE_VISUALISATIONS=./{{ cookiecutter.repo_name }}/src/make_visualisations
DIR_SRC_UTILS=./{{ cookiecutter.repo_name }}/src/utils
DIR_SRC_COOKIECUTTER.REPO_NAME=./src/{{ cookiecutter.repo_name }}

# Add environment variables for the `tests` directory
DIR_COOKIECUTTER.REPO_NAME_TESTS=./{{ cookiecutter.repo_name }}/tests
DIR_TESTS=./tests
19 changes: 5 additions & 14 deletions {{ cookiecutter.repo_name }}/data/README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,11 @@
# `data` folder overview

Any data that needs to be stored locally should be saved in this location. This folder,
and its sub-folders, are not version-controlled.
Any data that needs to be stored locally should be saved in this location.

The sub-folders should be used as follows:

- `external`: any data that will not be processed at all, such as reference data;
- `raw`: any raw data before any processing;
- `interim`: any raw data that has been partially processed and, for whatever reason,
needs to be stored before further processing is completed; and
- `processed`: any raw or interim data that has been fully processed into its final
state.
Most data files should not be pushed to your repository, therefore make
sure your .gitignore file excludes your data files from git commits. An
exemption to this may be an example data file that another user may use in
a tutorial for your package.

The paths for these directories are loaded as environment variables by the
`.envrc` file. To load them in Python, use any or all of the following code:
Expand All @@ -20,8 +15,4 @@ import os

# Load environment variables for the `data` folder, and its sub-folders
DIR_DATA = os.getenv("DIR_DATA")
DIR_DATA_EXTERNAL = os.getenv("DIR_DATA_EXTERNAL")
DIR_DATA_RAW = os.getenv("DIR_DATA_RAW")
DIR_DATA_INTERIM = os.getenv("DIR_DATA_INTERIM")
DIR_DATA_PROCESSED = os.getenv("DIR_DATA_PROCESSED")
```
Empty file.
Empty file.
Empty file.
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -58,15 +58,6 @@ create a ReST file, and add the following line to reference the `{{ cookiecutter
Then, elsewhere in the body, [call the `autosummary` directive to generate the
docstrings as ReST stub files][sphinx-autosummary].

```rest
.. autosummary::
:toctree: api/
hello
world
```

[This will create something similar to the `pandas` API
reference][pandas-api-reference].

Expand Down Expand Up @@ -95,17 +86,6 @@ create a Markdown file, and add the following line to reference the `{{ cookiecu
Then, elsewhere in the body, [call the `autosummary` directive to generate the
docstrings as ReST stub files][sphinx-autosummary].

````md
```{eval-rst}
.. autosummary::
:toctree: api/

hello
world

```
````

### Including Markdown files outside the `docs` folder

[MyST lets you include Markdown files outside the `docs` folder][myst-include].
Expand Down
2 changes: 0 additions & 2 deletions {{ cookiecutter.repo_name }}/docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,4 @@ self
./user_guide/README.md
./contributor_guide/README.md
./aqa/README.md
./structure/README.md
./reference/README.md
```
14 changes: 0 additions & 14 deletions {{ cookiecutter.repo_name }}/docs/reference/README.md

This file was deleted.

15 changes: 0 additions & 15 deletions {{ cookiecutter.repo_name }}/docs/reference/make_data.md

This file was deleted.

15 changes: 0 additions & 15 deletions {{ cookiecutter.repo_name }}/docs/reference/make_features.md

This file was deleted.

15 changes: 0 additions & 15 deletions {{ cookiecutter.repo_name }}/docs/reference/make_models.md

This file was deleted.

15 changes: 0 additions & 15 deletions {{ cookiecutter.repo_name }}/docs/reference/make_visualisations.md

This file was deleted.

15 changes: 0 additions & 15 deletions {{ cookiecutter.repo_name }}/docs/reference/src.md

This file was deleted.

15 changes: 0 additions & 15 deletions {{ cookiecutter.repo_name }}/docs/reference/utils.md

This file was deleted.

Loading

0 comments on commit 79dfe60

Please sign in to comment.