Skip to content

Commit

Permalink
Inital commit
Browse files Browse the repository at this point in the history
  • Loading branch information
george-w-jenkins committed Jul 29, 2024
0 parents commit d777cc3
Show file tree
Hide file tree
Showing 33 changed files with 2,935 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[flake8]
# Rule definitions: http://flake8.pycqa.org/en/latest/user/error-codes.html
# D203: 1 blank line required before class docstring
# W503: line break before binary operator
exclude = venv*,__pycache__,node_modules,bower_components,migrations
ignore = D203,W503
max-complexity = 9
max-line-length = 88
extend-ignore = E203
36 changes: 36 additions & 0 deletions .github/workflows/qa.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: QA
on: [push]

jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master

- name: Set up Python 3.12
uses: actions/setup-python@v3
with:
python-version: 3.12.3


- name: Install dependencies
run: |
python3 -m pip install --no-cache-dir --upgrade pip
python3 -m pip install --no-cache-dir -r requirements.txt
- name: Format code
run: |
python3 -m black src
- name: Lint with flake8
run: |
python3 -m flake8 src
- name: Sort imports
run: |
python3 -m isort src
- name: Test with pytest
run: |
python3 -m pytest -vv
87 changes: 87 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
# R template file for .gitignore
# with added csv/xls to ignore datafiles

# History files
.Rhistory
.Rapp.history

# Session Data files
.RData
.RDataTmp

# User-specific files
.Ruserdata

# Example code in package build process
*-Ex.R

# Output files from R CMD build
/*.tar.gz

# Output files from R CMD check
/*.Rcheck/

# RStudio files
#.Rproj.user/

# produced vignettes
vignettes/*.html
vignettes/*.pdf

# OAuth2 token, see https://github.com/hadley/httr/releases/tag/v0.3
.httr-oauth

# knitr and R markdown default cache directories
*_cache/
/cache/

# Temporary files created by R markdown
*.utf8.md
*.knit.md

# R Environment Variables
.Renviron

# pkgdown site

# translation temp files
po/*~

# RStudio Connect folder
rsconnect/

# Data files
*.csv
*.xlsx
*.ods
*.docx
*.rds

# PowerBi files
*.pbix
.Rproj.user/
.Rproj.user

# Markdown folder
markdown/

outputs/*
output.txt
workspace
src/old files
# data files
inputs/*/*
inputs/data/*
inputs/data/*/*
#!inputs/data/.gitkeep
!outputs/.gitkeep
.vscode/
pyproject.toml

*.csv
*.xls
*.xlsx
*.ods

.env
__pycache__
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2024 DHSC Data Science

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
67 changes: 67 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# The Better Regulations Tool

[![QA](https://github.com/DataS-DHSC//better-regulations-tool/actions/workflows/qa.yml/badge.svg)](https://github.com/DataS-DHSC//better-regulations-toolactions/workflows/qa.yml)

A tool to support the identification of Review Clauses in legislation.

## Setting up

In order to use this tool, you will need a machine with `conda` installed.

### Quickstart

To set up, open a terminal and create an environment from the provided environemnt.yml file using:
```
conda env create -f environment.yml`
```
Then activate the environment using:
```
conda activate better-regulations-tool-env
```

To run the tool using the default settings use

```
python search_main.py
```

To change the settings and a run a customized search edit the `example_config.yml` file.
This file is found in the `inputs/configs` folder
The parameters in the config.yml are explained in more detail in the user guide [here](https://github.com/DataS-DHSC/better-regulations-tool/blob/main/docs/user_guide.md)


## License

Unless stated otherwise, the codebase is released under the MIT License. This covers both the codebase and any sample code in the documentation. The documentation is © Crown copyright and available under the terms of the Open Government 3.0 licence.


### Requirements

- conda installed

- Python 3.12+ installed


## Project Organization

├── .github <- Github actions and workflows.
├── docs <- Markdown documentation and user guide.
├── inputs
│ ├── data <- Raw and intermediary data.
│ └── configs <- Config files.
├── outputs <- Output data, logs and configs.
├── src <- Source code.
│ └── toolkit <- Toolkit subpackage.
├── tests <- Unit tests.
├── .flake8 <- Linter configuration file for QA.
├── .gitignore <- Detailing folders and file types which will not be committed.
├── environment.yml <- Dependency list for creating conda environment.
├── LICENSE <- License file.
├── main.py <- Main file for running tool.
|── README.md <- The top-level README.
└── requirements.txt <- Dependency list for QA only. Please use environment.yml

### Contact

For queries, help or feedback please contact the [DHSC Data Science Hub](mailto:[email protected]).

1 change: 1 addition & 0 deletions docs/images/better_regs_figure.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit d777cc3

Please sign in to comment.