Skip to content

Commit

Permalink
added demodata and extractor classes. initla pre commit setup
Browse files Browse the repository at this point in the history
  • Loading branch information
iwpnd committed Feb 15, 2020
1 parent e21240c commit fb535c5
Show file tree
Hide file tree
Showing 8 changed files with 594 additions and 344 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ __pycache__/
*.py[cod]
*$py.class
flash-geotext.code-workspace
*.ipynb

# C extensions
*.so
Expand Down
24 changes: 24 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.3.0
hooks:
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace
- id: check-json
- id: check-added-large-files
- id: check-ast
- repo: https://github.com/psf/black
rev: 19.3b0
hooks:
- id: black
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v1.2.3
hooks:
- id: flake8
args: ["--ignore=E203,W503,E501"]
- repo: https://github.com/asottile/reorder_python_imports
rev: v1.4.0
hooks:
- id: reorder-python-imports
language_version: python3
11 changes: 11 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
language: python
python:
- "3.6"
- "3.7"

# command to install dependencies
install:
- pip install -e .

# command to run tests
script: pytest -v
Empty file added flashgeotext/__init__.py
Empty file.
21 changes: 21 additions & 0 deletions flashgeotext/extractor.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
from flashtext import KeywordProcessor


class Alphabets(object):
pass


class DemoData(object):
cities: list = []
countries: list = []

def __init__(self):
pass


class Extractor(object):
cities: KeywordProcessor = KeywordProcessor
countries: KeywordProcessor = KeywordProcessor

def __init__(self):
pass
Empty file added flashgeotext/settings.py
Empty file.
865 changes: 521 additions & 344 deletions scripts/Untitled.ipynb

Large diffs are not rendered by default.

16 changes: 16 additions & 0 deletions tests/unit/test_extractor.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
from flashgeotext.extractor import DemoData
from flashgeotext.extractor import Extractor


def test_extractor_import():
ext = Extractor()
assert ext
assert hasattr(ext, "cities")
assert hasattr(ext, "countries")


def test_demodata_content():
demodata = DemoData()

assert hasattr(demodata, "cities")
assert hasattr(demodata, "countries")

0 comments on commit fb535c5

Please sign in to comment.