Skip to content

Commit

Permalink
Merge branch 'release/3.1.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
dermatologist committed Sep 17, 2021
2 parents 1b5aa03 + f4d6336 commit b43b394
Show file tree
Hide file tree
Showing 35 changed files with 640 additions and 381 deletions.
20 changes: 20 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# [Choice] Python version: 3, 3.9, 3.8, 3.7, 3.6
ARG VARIANT=3.7
FROM mcr.microsoft.com/vscode/devcontainers/python:${VARIANT}

# [Option] Install Node.js
ARG INSTALL_NODE="true"
ARG NODE_VERSION="lts/*"
RUN if [ "${INSTALL_NODE}" = "true" ]; then su vscode -c "umask 0002 && . /usr/local/share/nvm/nvm.sh && nvm install ${NODE_VERSION} 2>&1"; fi

# [Optional] If your pip requirements rarely change, uncomment this section to add them to the image.
# COPY requirements.txt /tmp/pip-tmp/
# RUN pip3 --disable-pip-version-check --no-cache-dir install -r /tmp/pip-tmp/requirements.txt \
# && rm -rf /tmp/pip-tmp

# [Optional] Uncomment this section to install additional OS packages.
# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
# && apt-get -y install --no-install-recommends <your-package-list-here>

# [Optional] Uncomment this line to install global node packages.
# RUN su vscode -c "source /usr/local/share/nvm/nvm.sh && npm install -g <your-package-here>" 2>&1
47 changes: 47 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{
"name": "Python 3",
"build": {
"dockerfile": "Dockerfile",
"context": "..",
"args": {
// Update 'VARIANT' to pick a Python version: 3, 3.6, 3.7, 3.8, 3.9
"VARIANT": "3.7",
// Options
"INSTALL_NODE": "false",
"NODE_VERSION": "lts/*"
}
},
"containerEnv": {
"GITHUB_TOKEN": "${localEnv:GITHUB_TOKEN}",
"GITHUB_USER": "${localEnv:GITHUB_USER}"
},
"workspaceFolder": "/nlp-qrmine",
"workspaceMount": "src=nlp-qrmine,dst=/nlp-qrmine,type=volume,volume-driver=local",
// Set *default* container specific settings.json values on container create.
"settings": {
"python.pythonPath": "/usr/local/bin/python",
"python.languageServer": "Pylance",
"python.linting.enabled": true,
"python.linting.pylintEnabled": true,
"python.formatting.autopep8Path": "/usr/local/py-utils/bin/autopep8",
"python.formatting.blackPath": "/usr/local/py-utils/bin/black",
"python.formatting.yapfPath": "/usr/local/py-utils/bin/yapf",
"python.linting.banditPath": "/usr/local/py-utils/bin/bandit",
"python.linting.flake8Path": "/usr/local/py-utils/bin/flake8",
"python.linting.mypyPath": "/usr/local/py-utils/bin/mypy",
"python.linting.pycodestylePath": "/usr/local/py-utils/bin/pycodestyle",
"python.linting.pydocstylePath": "/usr/local/py-utils/bin/pydocstyle",
"python.linting.pylintPath": "/usr/local/py-utils/bin/pylint"
},
// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"ms-python.python",
"ms-python.vscode-pylance"
],
// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],
// Use 'postCreateCommand' to run commands after the container is created.
"postCreateCommand": "pip3 install --user -r requirements.txt -r dev-requirements.txt",
// Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
// "remoteUser": "vscode"
}
25 changes: 25 additions & 0 deletions .github/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Configurations for todo: https://probot.github.io/apps/todo/
# Automatically add issues from @todo with @body
# /**
# * @todo What needs to be done
# * @body How to do it.
# */

# https://github.com/behaviorbot/welcome
newIssueWelcomeComment: >
Thank you for raising this issue. We will try and get back to you as soon as possible.
Be sure to star ✨ the repository for a priority response!
Please make sure you have given us as much context as possible.
newPRWelcomeComment: >
Thank you for submitting a pull request.
Please make sure you have followed our contributing guidelines in CONTRIBUTING.md. We will review it as soon as possible.
Be sure to star ✨ the repository.
firstPRMergeComment: >
Congrats on merging your first pull request! 🎉🎉🎉
12 changes: 12 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
version: 2
updates:
- package-ecosystem: pip
directory: "/"
schedule:
interval: "weekly"
# open-pull-requests-limit: 10

- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
27 changes: 27 additions & 0 deletions .github/workflows/bump.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Generate changelog

on:
push:
branches:
- "release/**"

jobs:
build:

runs-on: ubuntu-latest
timeout-minutes: 5

steps:
- name: Checkout Latest Commit
uses: actions/checkout@v2

- name: Generate changelog
uses: charmixer/auto-changelog-action@v1
with:
token: ${{ secrets.github_token }}

- name: Commit changes
uses: EndBug/add-and-commit@v7
with:
default_author: github_actions
add: '*.md'
29 changes: 29 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Generate and publish gh-pages
# https://docs.github.com/en/actions/guides/building-and-testing-python
# https://packaging.python.org/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/
on:
release:
types: [published]

jobs:
deploy:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v2.3.4
- name: Set up Python
uses: actions/setup-python@v2.2.2
with:
python-version: '3.8'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt -r dev-requirements.txt
- name: Create docs
run: |
make -C docs/ html
- name: Deploy Docs 🚀
uses: JamesIves/github-pages-deploy-action@4.1.5
with:
branch: gh-pages # The branch the action should deploy to.
folder: docs/_build/html # The folder the action should deploy.
30 changes: 30 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Upload Python Package to PyPi
# https://docs.github.com/en/actions/guides/building-and-testing-python
# https://packaging.python.org/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/
on:
release:
types: [published]

jobs:
deploy:
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@v2.3.4
- name: Set up Python
uses: actions/setup-python@v2.2.2
with:
python-version: '3.8'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r dev-requirements.txt
- name: Build and publish
run: |
python setup.py bdist_wheel
- name: Publish distribution 📦 to PyPI
if: startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
6 changes: 3 additions & 3 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ jobs:
python-version: [3.7]

steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v2.3.4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
uses: actions/setup-python@v2.2.2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install -r dev-requirements.txt -r requirements.txt
- name: Test with pytest
run: |
pytest
9 changes: 4 additions & 5 deletions .github/workflows/tox.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,18 @@ jobs:
strategy:
max-parallel: 4
matrix:
python-version: [3.7]
python-version: [3.8]

steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v2.3.4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
uses: actions/setup-python@v2.2.2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install tox
pip install -r dev-requirements.txt -r requirements.txt
- name: Test with tox
run: |
tox
22 changes: 22 additions & 0 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

# Required
version: 2

# Build documentation in the docs/ directory with Sphinx
sphinx:
configuration: docs/conf.py

# Build documentation with MkDocs
#mkdocs:
# configuration: mkdocs.yml

# Optionally build your docs in additional formats such as PDF
formats:
- pdf

python:
version: 3.8
install:
- requirements: docs/requirements.txt
3 changes: 3 additions & 0 deletions AUTHORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Contributors

* Bell Eapen <github@gulfdoctor.net>
5 changes: 0 additions & 5 deletions AUTHORS.rst

This file was deleted.

42 changes: 42 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Changelog

## [Unreleased](https://github.com/dermatologist/pyomop/tree/HEAD)

[Full Changelog](https://github.com/dermatologist/pyomop/compare/3.0.0...HEAD)

**Closed issues:**

- Import directly \(no need for conditional\) when `python_requires = >= 3.8` [\#12](https://github.com/dermatologist/pyomop/issues/12)
- ", [\#11](https://github.com/dermatologist/pyomop/issues/11)

## [3.0.0](https://github.com/dermatologist/pyomop/tree/3.0.0) (2020-10-23)

[Full Changelog](https://github.com/dermatologist/pyomop/compare/2.0.0...3.0.0)

## [2.0.0](https://github.com/dermatologist/pyomop/tree/2.0.0) (2020-06-27)

[Full Changelog](https://github.com/dermatologist/pyomop/compare/1.2.0...2.0.0)

## [1.2.0](https://github.com/dermatologist/pyomop/tree/1.2.0) (2020-05-23)

[Full Changelog](https://github.com/dermatologist/pyomop/compare/1.1.1...1.2.0)

## [1.1.1](https://github.com/dermatologist/pyomop/tree/1.1.1) (2020-05-03)

[Full Changelog](https://github.com/dermatologist/pyomop/compare/1.1.0...1.1.1)

## [1.1.0](https://github.com/dermatologist/pyomop/tree/1.1.0) (2020-05-03)

[Full Changelog](https://github.com/dermatologist/pyomop/compare/1.0.0...1.1.0)

## [1.0.0](https://github.com/dermatologist/pyomop/tree/1.0.0) (2020-05-03)

[Full Changelog](https://github.com/dermatologist/pyomop/compare/0.1.0...1.0.0)

## [0.1.0](https://github.com/dermatologist/pyomop/tree/0.1.0) (2020-05-03)

[Full Changelog](https://github.com/dermatologist/pyomop/compare/c647331d8bcb13f0353f85a49ed552294631fee3...0.1.0)



\* *This Changelog was automatically generated by [github_changelog_generator](https://github.com/github-changelog-generator/github-changelog-generator)*
10 changes: 0 additions & 10 deletions CHANGELOG.rst

This file was deleted.

File renamed without changes.
36 changes: 27 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
# pyomop
# :notebook: pyomop

OMOP CDM utils. This repo may be similar to [@jbadger3's](https://github.com/jbadger3) [inspectomop](https://github.com/jbadger3/inspectomop), but this is not a fork.
[![forthebadge made-with-python](http://ForTheBadge.com/images/badges/made-with-python.svg)](https://www.python.org/)
[![PyPI download total](https://img.shields.io/pypi/dm/pyomop.svg)](https://pypi.python.org/pypi/pyomop/)
[![Build](https://github.com/dermatologist/pyomop/workflows/Python%20Test/badge.svg)](https://nuchange.ca)

* *Inspired by [@jbadger3's](https://github.com/jbadger3) [inspectomop](https://github.com/jbadger3/inspectomop)*

## Description

The [OHSDI](https://www.ohdsi.org/) OMOP Common Data Model allows for the systematic analysis of healthcare observational databases. This is a python library to use the CDM v6 compliant databases using SQLAlchemy as the ORM. **pyomop** also supports converting query results to a pandas dataframe (see below) for use in machine learning pipelines. See some useful [SQL Queries here.](https://github.com/OHDSI/QueryLibrary)

### Support
* Postgres
* MySQL
* SqLite
* More to follow..

## Installation

```
Expand Down Expand Up @@ -74,7 +72,27 @@ print(vec.df.dtypes) # vec.df is a pandas dataframe
pyomop -help
```

## Troubleshoot

* sqlalchemy > 1.4 may not work. See [issue #6](https://github.com/dermatologist/pyomop/issues/6). Please downgrade sqlalchemy untill [issue #6](https://github.com/dermatologist/pyomop/issues/6) is fixed.
```
pip install sqlalchemy==1.3.24
```

## Other utils

**Want to convert FHIR to pandas data frame? Try [fhiry](https://github.com/dermatologist/fhiry)**

**Use the same functions in [.NET](https://github.com/dermatologist/omopcdm-dot-net) and [Golang](https://github.com/E-Health/gocdm)!**

### Support
* Postgres
* MySQL
* SqLite
* More to follow..


## Contributors

* [Bell Eapen](https://nuchange.ca)
* [Bell Eapen](https://nuchange.ca) | [![Twitter Follow](https://img.shields.io/twitter/follow/beapen?style=social)](https://twitter.com/beapen)
* PRs welcome. See CONTRIBUTING.md
10 changes: 10 additions & 0 deletions dev-requirements.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# dev-requirements.in
-c requirements.txt
pytest-cov
pytest
recommonmark
sphinx>=3.2.1
setuptools
setuptools_scm
wheel
tox

0 comments on commit b43b394

Please sign in to comment.