Skip to content

Commit

Permalink
Merge branch 'release/1.0.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
dermatologist committed May 3, 2020
2 parents 243c4a5 + 560121c commit 10d5ab9
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 28 deletions.
10 changes: 3 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

OMOP CDM utils


## Description

A longer description of your project goes here...
A python library for using the OMOP Common Data Model.

## Installation

```
pip install pyomop
pip install https://github.com/dermatologist/pyomop/releases/download/1.0.0/pyomop-1.0.0-py2.py3-none-any.whl
```

## Usage
Expand Down Expand Up @@ -41,7 +41,3 @@ for row in result:
```

## Note

This project has been set up using PyScaffold 3.2.3. For details and usage
information on PyScaffold see https://pyscaffold.org/.
6 changes: 3 additions & 3 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ testing =
# And any other entry points, for example:
# pyscaffold.cli =
# awesome = pyscaffoldext.awesome.extension:AwesomeExtension
[console_scripts]
pyomop = pyomop.main:main_routine
console_scripts =
pyomop = pyomop.main:main_routine

[test]
# py.test options when running `python setup.py test`
Expand All @@ -78,7 +78,7 @@ extras = True
# e.g. --cov-report html (or xml) for html/xml output or --junitxml junit.xml
# in order to write a coverage file that can be read by Jenkins.
addopts =
--cov pyomop --cov-report term-missing
#--cov pyomop --cov-report term-missing
--verbose
norecursedirs =
dist
Expand Down
4 changes: 2 additions & 2 deletions src/pyomop/__init__.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# -*- coding: utf-8 -*-
from pkg_resources import get_distribution, DistributionNotFound

from engine_factory import CdmEngineFactory
from cdm6_tables import metadata
from .engine_factory import CdmEngineFactory
from .cdm6_tables import metadata

try:
# Change here if project is renamed and does not equal the package name
Expand Down
Empty file added tests/__init__.py
Empty file.
30 changes: 30 additions & 0 deletions tests/test_pyomop.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import pytest

@pytest.fixture
def pyomop_fixture():
from src.pyomop import CdmEngineFactory
cdm = CdmEngineFactory()
return cdm

@pytest.fixture
def metadata_fixture():
from src.pyomop import metadata
return metadata

def test_create_db(pyomop_fixture, metadata_fixture, capsys):
import datetime
from sqlalchemy.sql import select
engine = pyomop_fixture.engine
metadata_fixture.create_all(engine)
Cohort = pyomop_fixture.base.cohort
session = pyomop_fixture.session
session.add(Cohort(cohort_definition_id=2, subject_id=100,
cohort_end_date=datetime.datetime.now(),
cohort_start_date=datetime.datetime.now()))
session.commit()

s = select([Cohort])
result = session.execute(s)
for row in result:
print(row)
assert row['subject_id'] == 100
16 changes: 0 additions & 16 deletions tests/test_skeleton.py

This file was deleted.

0 comments on commit 10d5ab9

Please sign in to comment.