Skip to content

Commit

Permalink
Merge branch 'main' into pr/50
Browse files Browse the repository at this point in the history
  • Loading branch information
jas88 committed Dec 11, 2023
2 parents 9f2a8d4 + ad61478 commit c138c7f
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 30 deletions.
28 changes: 14 additions & 14 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ default_language_version:

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: "v4.3.0"
rev: "v4.5.0"
hooks:
# General
- id: check-added-large-files
Expand Down Expand Up @@ -35,7 +35,7 @@ repos:
- id: check-hooks-apply
- id: check-useless-excludes
- repo: https://github.com/codespell-project/codespell
rev: "v2.2.2"
rev: "v2.2.6"
hooks:
- id: codespell
args:
Expand All @@ -48,18 +48,18 @@ repos:
'\Whttps?://\S*',
]
- repo: https://github.com/pre-commit/mirrors-prettier
rev: "v3.0.0-alpha.4"
rev: "v4.0.0-alpha.4"
hooks:
- id: prettier
args: [--config, .meta/prettierrc.yml]
- repo: https://github.com/adrienverge/yamllint
rev: "v1.28.0"
rev: "v1.33.0"
hooks:
- id: yamllint
args: [-c, .meta/yamllint.yaml]
# Shell
- repo: https://github.com/shellcheck-py/shellcheck-py
rev: "v0.8.0.4"
rev: "v0.9.0.6"
hooks:
- id: shellcheck
# Python
Expand All @@ -68,44 +68,44 @@ repos:
# hooks:
# - id: setup-cfg-fmt
- repo: https://github.com/pre-commit/pygrep-hooks
rev: "v1.9.0"
rev: "v1.10.0"
hooks:
- id: python-check-blanket-noqa
- id: python-check-mock-methods
- id: python-use-type-annotations
- id: python-no-log-warn
- repo: https://github.com/asottile/reorder_python_imports
rev: "v3.9.0"
- repo: https://github.com/asottile/reorder-python-imports
rev: "v3.12.0"
hooks:
- id: reorder-python-imports
args: [--py36-plus]
- repo: https://github.com/asottile/add-trailing-comma
rev: "v2.3.0"
rev: "v3.1.0"
hooks:
- id: add-trailing-comma
args: [--py36-plus]
- repo: https://github.com/asottile/pyupgrade
rev: "v3.2.0"
rev: "v3.15.0"
hooks:
- id: pyupgrade
args: [--py36-plus]
- repo: https://github.com/asottile/yesqa
rev: "v1.4.0"
rev: "v1.5.0"
hooks:
- id: yesqa
additional_dependencies: [pep8-naming]
- repo: https://github.com/pre-commit/mirrors-mypy
rev: "v0.982"
rev: "v1.7.1"
hooks:
- id: mypy
args: [--config-file, .meta/mypy.ini]
- repo: https://github.com/psf/black
rev: "22.10.0"
rev: "23.11.0"
hooks:
- id: black
language_version: python38
- repo: https://github.com/PyCQA/flake8
rev: "5.0.4"
rev: "6.1.0"
hooks:
- id: flake8
additional_dependencies:
Expand Down
2 changes: 0 additions & 2 deletions create_archive.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@


def _log_disk_usage(input_files: Tuple[Path]) -> None:

escaped_root = str(PACS_ROOT).replace("/", r"\/")
cmd = (
rf"sed 's/^/{escaped_root}\//g' {' '.join((str(x) for x in input_files))} "
Expand All @@ -72,7 +71,6 @@ def _log_disk_usage(input_files: Tuple[Path]) -> None:


def main() -> int:

logging.info(f"Starting on {os.uname()[1]}")

parser = argparse.ArgumentParser()
Expand Down
26 changes: 13 additions & 13 deletions queries/extractAllSeriesRange.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,27 @@
// date. Usage: mongo --eval \"const date='201501'\" <script-name>.js"

if (typeof date === "undefined") {
print("date must be passed to the script")
quit()
print("date must be passed to the script");
quit();
}

const CONN = new Mongo()
CONN.getDB("admin").auth("...", "...")
const CONN = new Mongo();
CONN.getDB("admin").auth("...", "...");

print("PatientID,DirectoryPath,Modality,ImagesInSeries")
print("PatientID,DirectoryPath,Modality,ImagesInSeries");

const DB_NAME = "dicom"
const DB_NAME = "dicom";
CONN.getDB(DB_NAME)
.getCollection("series")
.find({
StudyDate: new RegExp("^" + date),
})
.forEach(function (doc) {
// TODO(rkm 2020-10-27) Need to escape commas in some PatientIDs
s = ""
s += doc["PatientID"] + ","
s += doc["header"]["DirectoryPath"] + ","
s += doc["Modality"] + ","
s += doc["header"]["ImagesInSeries"]
print(s)
})
s = "";
s += doc["PatientID"] + ",";
s += doc["header"]["DirectoryPath"] + ",";
s += doc["Modality"] + ",";
s += doc["header"]["ImagesInSeries"];
print(s);
});
1 change: 0 additions & 1 deletion queries/processCounts.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ def process_csv(csv_path: Path) -> Counter[str]:


def main() -> int:

totals: Counter[str] = Counter()
for f in sorted(glob.glob("results/proj_name_*.csv")):
totals += Counter(process_csv(Path(f)))
Expand Down

0 comments on commit c138c7f

Please sign in to comment.