Skip to content

Commit

Permalink
Apply precommit
Browse files Browse the repository at this point in the history
  • Loading branch information
lizgzil committed Jul 26, 2024
1 parent 2a69e88 commit 3b446d8
Show file tree
Hide file tree
Showing 9 changed files with 26 additions and 23 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CONFIG_FILE: docs/mkdocs.yml
REQUIREMENTS: docs/site_assets/requirements.txt
REQUIREMENTS: docs/site_assets/requirements.txt
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ repos:
- repo: https://github.com/prettier/pre-commit
rev: v2.1.2
hooks:
- id: prettier
- id: prettier
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
# nlp-link
A python package to semantically link two lists of texts.

A python package to semantically link two lists of texts.

## Set-up

In setting up this project we ran:

```
conda create --name nlp-link pip python=3.9
conda activate nlp-link
pip install poetry
pip install pre-commit
pip install pre-commit black
pre-commit install
```

```
Expand Down Expand Up @@ -38,6 +40,6 @@ However, if you are editing the docs you can test them out locally by running

```
cd guidelines
pip install -r docs/requirements.txt
pip install -r docs/requirements.txt
mkdocs serve
```
2 changes: 1 addition & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

Documentation for NLP Link

- [Page1](./page1.md)
- [Page1](./page1.md)
2 changes: 1 addition & 1 deletion docs/mkdocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,4 @@ nav:
- Home: README.md
- Page 1: page1.md
plugins:
- same-dir
- same-dir
2 changes: 1 addition & 1 deletion docs/page1.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
## Title
## Title
8 changes: 4 additions & 4 deletions docs/site_assets/style.css
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
@import url('https://fonts.cdnfonts.com/css/century-gothic');
@import url("https://fonts.cdnfonts.com/css/century-gothic");
html,
body,
[class*="css"] {
font-family: "Century Gothic";
}
:root {
--md-primary-fg-color: #18A48C;
--md-accent-fg-color: #EB003B;
}
--md-primary-fg-color: #18a48c;
--md-accent-fg-color: #eb003b;
}
13 changes: 7 additions & 6 deletions nlp_link/linker.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import pandas as pd
import random


def link_lists(list_1, list_2):
"""
Mock linker
"""
list_1_index = list(range(len(list_1)))
list_2_index = list(range(len(list_2)))
"""
Mock linker
"""
list_1_index = list(range(len(list_1)))
list_2_index = list(range(len(list_2)))

return [(i, random.choice(list_1_index)) for i in list_2_index]
return [(i, random.choice(list_1_index)) for i in list_2_index]
10 changes: 5 additions & 5 deletions tests/test_linker.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
from nlp_link.linker import link_lists

def test_link_lists():

list_1 = ["dog", "cat"]
list_2 = ["kitten", "puppy"]
linked = link_lists(list_1, list_2)
def test_link_lists():

assert len(linked) == len(list_1)
list_1 = ["dog", "cat"]
list_2 = ["kitten", "puppy"]
linked = link_lists(list_1, list_2)

assert len(linked) == len(list_1)

0 comments on commit 3b446d8

Please sign in to comment.