Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue 134 authorship #135

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 23 additions & 17 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,28 +1,31 @@
[metadata]
# would we ever want to use pyproject.toml ?
# yes! works with setuptools and poetry

name = crdch_model
# see home_page notes
url = https://cancerdhc.github.io/ccdhmodel
# author metadata, license etc is totally incomplete
# str
# add maintainer
author = Mark A. Miller
author_email = [email protected]
# summary is alias for description ?
summary = CRDC-H model in LinkML, developed by the Center for Cancer Data Harmonization (CCDH)
# version

author = Center for Cancer Data Harmonization
# are we sure somebody reads this email?
author_email = [email protected]
maintainer = Gaurav Vaidya, Sujay Patil, Mark A. Miller etc. See https://github.com/cancerDHC/ccdhmodel/graphs/contributors

# summary is alias for description
description = CRDC-H model in LinkML, developed by the Center for Cancer Data Harmonization (CCDH)

long_description = CRDC-H model in LinkML, developed by the Center for Cancer Data Harmonization (CCDH). This Python package contains the dataclasses necessary to build and operate over data objects according to the CRDC-H model.
# is this where mkdocs artifacts gets SENT?
# or will this be used as a base for URLs in the mkdocs artifacts?
# should change, but be careful not to overwrite the existing ccdhmodel docs yet
# no, this is probably just what appears on the package's PyPI page
# see also url
# https://setuptools.readthedocs.io/en/latest/userguide/declarative_config.html says
# home-page is an alias for url


# see also https://setuptools.readthedocs.io/en/latest/userguide/declarative_config.html
# which says home-page is an alias for url
# note hyphen vs underscore!
home_page = https://cancerdhc.github.io/ccdhmodel
url = https://cancerdhc.github.io/ccdhmodel

# LICENSE file looks like BSD 3-clause
# license = MIT
license = MIT
python_requires = >=3.7

classifiers =
Topic :: Scientific/Engineering :: Bio-Informatics
Intended Audience :: Healthcare Industry
Expand All @@ -36,10 +39,13 @@ classifiers =
Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9

# MAM 2021-11-18 cancer research
keywords =
python
google-sheets
linkml
cancer research

[options]
include_package_data = True
Expand Down
11 changes: 11 additions & 0 deletions tests/secondary_inputs/test_AlcoholExposureObservation.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"id": "a1b2c3",
"value_integer": 6,
"observation_type": {
"text": "alcohol_drinks_per_day",
"coding": {
"code": "marksterms:dpd",
"system": "http://example.com/broken_uris_ok/"
}
}
}
21 changes: 21 additions & 0 deletions tests/secondary_inputs/test_ObservationSet.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"id": "123",
"category": {
"coding": {
"code": "example:123",
"system": "http://example.com"
},
"text": "tobacco exposure observations"
},
"observations": [
{
"observation_type": {
"text": "cigarettes_per_day",
"coding": {
"code": "marksterms:cpd",
"system": "not a real uri"
}
}
}
]
}
9 changes: 9 additions & 0 deletions tests/secondary_inputs/test_TobaccoExposureObservation.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"observation_type": {
"text": "cigarettes_per_day",
"coding": {
"code": "marksterms:cpd",
"system": "not a real uri"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# can't be a list
# use observation set
# misspellings in text are tolerated, as are bogus uris in coding.system
# coding.system validationa s string instead of URI is a known bug
# can enums goin any of these slots?
# look at values from
# learn more about attributes vs slots
[
{ "observation_type": { "text": "cigarettes_per_dayZZZ", "coding": "marksterms:cpd" }},
{ "observation_type": { "text": "cigarettes_per_day" }}
]

35 changes: 35 additions & 0 deletions tests/test_alcohol_exp_static.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import os
import unittest

from linkml_runtime.loaders import json_loader, rdf_loader

from crdch_model.crdch_model import AlcoholExposureObservation

CWD = os.path.abspath(os.path.dirname(__file__))

INPUT_DIR = os.path.join(CWD, 'secondary_inputs')


class InputFileTestCase(unittest.TestCase):
def test_alcohol_file(self):
nyaml, njson, nttl = 0, 0, 0
pyaml, pjson, pttl = 0, 0, 0
nread, nfailures = 0, 0
print("AlcoholExposureObservation test")
alcohol_data_filename = 'test_AlcoholExposureObservation.json'
alcohol_data_filepath = os.path.join(INPUT_DIR, alcohol_data_filename)
print("Attempting to load " + alcohol_data_filepath + " as one or more AlcoholExposureObservation(s)")

try:
njson += 1
Diagnosis = json_loader.load(alcohol_data_filepath, AlcoholExposureObservation)
pjson += 1
print("Successfully parsed:")
print(Diagnosis)
except Exception as e:
print(e)
nfailures += 1
self.assertEqual(0, nfailures)

if __name__ == '__main__':
unittest.main()
35 changes: 35 additions & 0 deletions tests/test_tobacco_exp_static.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import os
import unittest

from linkml_runtime.loaders import json_loader, rdf_loader

from crdch_model.crdch_model import TobaccoExposureObservation

CWD = os.path.abspath(os.path.dirname(__file__))

INPUT_DIR = os.path.join(CWD, 'secondary_inputs')


class InputFileTestCase(unittest.TestCase):
def test_tobacco_file(self):
nyaml, njson, nttl = 0, 0, 0
pyaml, pjson, pttl = 0, 0, 0
nread, nfailures = 0, 0
print("TobaccoExposureObservation test")
toboacco_data_filename = 'test_TobaccoExposureObservation.json'
toboacco_data_filepath = os.path.join(INPUT_DIR, toboacco_data_filename)
print("Attempting to load " + toboacco_data_filepath + " as one or more TobaccoExposureObservation(s)")

try:
njson += 1
Diagnosis = json_loader.load(toboacco_data_filepath, TobaccoExposureObservation)
pjson += 1
print("Successfully parsed:")
print(Diagnosis)
except Exception as e:
print(e)
nfailures += 1
self.assertEqual(0, nfailures)

if __name__ == '__main__':
unittest.main()