Skip to content
This repository was archived by the owner on Feb 26, 2025. It is now read-only.

Commit 254617e

Browse files
authored
Initial version (#1)
1 parent 98ce121 commit 254617e

33 files changed

+112814
-55
lines changed
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: check-pull-request
2+
3+
on:
4+
# schedule:
5+
# - cron: '48 22 * * 0'
6+
pull_request:
7+
branches: [ master ]
8+
9+
10+
jobs:
11+
12+
check-pr:
13+
runs-on: ubuntu-latest
14+
timeout-minutes: 30
15+
16+
steps:
17+
- uses: actions/checkout@v2
18+
- name: Set up Python ${{ matrix.python-version }}
19+
uses: actions/setup-python@v2
20+
with:
21+
python-version: 3.9
22+
- name: Download and check source data
23+
run: |
24+
pip install -e .[dev]
25+
mkdir sr/temp
26+
python sr/main.py --dev --force-regeneration
27+
black sr/*py
28+
black sr/tables/*.py
29+
git diff --output=gitdiff.txt
30+
- name: Upload artifacts
31+
if: ${{ success() }}
32+
uses: actions/upload-artifact@v2
33+
with:
34+
name: diff
35+
path: gitdiff.txt

.gitignore

Lines changed: 2 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -21,36 +21,7 @@
2121
# Build/dist files
2222
dist/*
2323
build/*
24-
pydicom.egg-info/*
24+
*.egg-info
2525
distribute*.egg
2626
distribute*.tar.gz
27-
py3source
28-
.tox/*
29-
30-
# Docs build
31-
docs/_build/*
32-
doc/_build/*
33-
doc/auto_examples/*
34-
doc/generated/*
35-
doc/reference/generated/*
36-
37-
# coverage.py files
38-
.coverage
39-
40-
# PyCharm IDE files
41-
*.idea*
42-
43-
44-
# jupyter notebooks
45-
*.ipynb
46-
.ipynb_checkpoints/*
47-
tests/test_pixel.py
48-
49-
# mypy
50-
pydicom/.mypy_cache/*
51-
52-
# vscode
53-
.vscode/*
54-
55-
# virtualenv
56-
env/
27+
__pycache__

LICENSE

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
Copyright (c) 2021 pydicom contributors
22

3-
Except for portions outlined below, pydicom is released under an MIT license:
4-
53
Permission is hereby granted, free of charge, to any person obtaining a copy
64
of this software and associated documentation files (the "Software"), to deal
75
in the Software without restriction, including without limitation the rights

mypy.ini

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
[mypy]
2+
python_version = 3.9
3+
exclude = sr/(tables|temp)
4+
files = sr/
5+
show_error_codes = True
6+
warn_redundant_casts = True
7+
warn_unused_ignores = True
8+
warn_return_any = True
9+
warn_unreachable = True
10+
ignore_missing_imports = True
11+
disallow_untyped_calls = True
12+
disallow_untyped_defs = True
13+
disallow_incomplete_defs = True

setup.py

Lines changed: 43 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,35 @@
1+
from pathlib import Path
12
from setuptools import setup, find_packages
23

4+
5+
PROJECT_DIR = Path(__file__).parent.resolve(strict=True)
6+
7+
8+
def get_version() -> str:
9+
"""Return the package version as a str"""
10+
VERSION_FILE = PROJECT_DIR / "sr" / "_version.py"
11+
_globals = {}
12+
with open(VERSION_FILE) as f:
13+
exec(f.read(), _globals)
14+
15+
return _globals["__version__"]
16+
17+
318
setup(
4-
name = "pydicom-data-sr",
5-
packages = find_packages(),
6-
include_package_data = True,
7-
version = __version__,
8-
zip_safe = False,
9-
description = "",
10-
long_description = "",
11-
long_description_content_type = "text/markdown",
12-
author = "scaramallion",
13-
author_email = "[email protected]",
14-
url = "https://github.com/pydicom/pydicom-sr-data",
15-
license = "MIT",
16-
keywords = "dicom python pydicom sr structuredreports",
17-
classifiers = [
19+
name="pydicom-data-sr",
20+
packages=find_packages(),
21+
include_package_data=True,
22+
version=get_version(),
23+
zip_safe=False,
24+
description="",
25+
long_description="",
26+
long_description_content_type="text/markdown",
27+
author="scaramallion",
28+
author_email="[email protected]",
29+
url="https://github.com/pydicom/pydicom-sr-data",
30+
license="MIT",
31+
keywords="dicom python pydicom sr structuredreports",
32+
classifiers=[
1833
"License :: OSI Approved :: MIT License",
1934
"Intended Audience :: Developers",
2035
"Intended Audience :: Healthcare Industry",
@@ -29,10 +44,19 @@
2944
"Topic :: Scientific/Engineering :: Medical Science Apps.",
3045
"Topic :: Software Development :: Libraries",
3146
],
32-
python_requires = ">=3.6",
33-
setup_requires = ["setuptools>=18.0"],
34-
install_requires = [],
35-
entry_points = {
47+
python_requires=">=3.6",
48+
setup_requires=["setuptools>=18.0"],
49+
install_requires=[],
50+
extras_require={
51+
"dev": [
52+
"beautifulsoup4==4.9.3",
53+
"requests==2.25.1",
54+
"black==21.6b0",
55+
"mypy==0.902",
56+
"types-requests==0.1.11",
57+
]
58+
},
59+
entry_points={
3660
"pydicom.data.external_sources": "pydicom-data-sr = srdata:DataStore",
37-
}
61+
},
3862
)

sr/__init__.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
from pathlib import Path
2+
3+
from sr._version import __version__
4+
5+
6+
PACKAGE_DIR = Path(__file__).parent.resolve(strict=True)
7+
HASH_FILE = PACKAGE_DIR / "hashes.json"
8+
VERSION_FILE = PACKAGE_DIR / "_version.py"
9+
10+
SR_TABLES = PACKAGE_DIR / "tables"
11+
CID_FILE = SR_TABLES / "_cid.py"
12+
CONCEPTS_FILE = SR_TABLES / "_concepts.py"
13+
SNOMED_FILE = SR_TABLES / "_snomed.py"

sr/_version.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
__version__: str = "2021.06.16"
2+
__dicom_version__: str = "2021b"

0 commit comments

Comments
 (0)