forked from Open-Minds-Lab/mrQA
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
65 changed files
with
7,739 additions
and
1,913 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
[run] | ||
branch = True | ||
omit = */tests/* | ||
_*.py | ||
plotting.py | ||
|
||
[report] | ||
; Regexes for lines to exclude from consideration | ||
exclude_also = | ||
; Don't complain about missing debug-only code: | ||
def __repr__ | ||
if self\.debug | ||
|
||
; Don't complain if tests don't hit defensive assertion code: | ||
raise AssertionError | ||
raise NotImplementedError | ||
|
||
; Don't complain if non-runnable code isn't run: | ||
if 0: | ||
if __name__ == .__main__.: | ||
|
||
; Don't complain about abstract methods, they aren't run: | ||
@(abc\.)?abstractmethod | ||
|
||
ignore_errors = True | ||
|
||
[html] | ||
directory = htmlcov |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,3 +19,6 @@ insert_final_newline = false | |
|
||
[Makefile] | ||
indent_style = tab | ||
|
||
[*.py] | ||
max_line_length = 80 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions | ||
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python | ||
|
||
name: tests | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python-version: [ "3.8" ] | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install git+https://github.com/sinhaharsh/protocol.git#egg=protocol | ||
pip install git+https://github.com/sinhaharsh/MRdataset.git#egg=MRdataset | ||
if [ -f requirements_dev.txt ]; then pip install -r requirements_dev.txt; fi | ||
pip install . | ||
- name: Lint with flake8 | ||
run: | | ||
# stop the build if there are Python syntax errors or undefined names | ||
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics | ||
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide | ||
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics | ||
- name: Test with pytest | ||
run: | | ||
pytest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -104,3 +104,6 @@ ENV/ | |
.vscode/ | ||
.idea/ | ||
/update_today.txt | ||
|
||
# codacy | ||
results.sarif |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
Command Line | ||
============ | ||
|
||
.. argparse:: | ||
:module: mrQA.cli | ||
:func: get_parser | ||
:prog: mrQA |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
from pathlib import Path | ||
from mrQA import monitor | ||
import tempfile | ||
import shutil | ||
|
||
from mrQA.tests.test_utils import copy2dest | ||
|
||
|
||
def run(folder_path): | ||
folder_path = Path(folder_path).resolve() | ||
config_path = Path('./mri-config.json').resolve() | ||
# make a temporary output folder using tempfile | ||
with tempfile.TemporaryDirectory() as tmpdirname: | ||
output_dir = Path(tmpdirname) / 'output' | ||
input_dir = Path(tmpdirname) / 'input' | ||
output_dir.mkdir(exist_ok=True, parents=True) | ||
input_dir.mkdir(exist_ok=True, parents=True) | ||
i = 0 | ||
# copy a folder from folder_path to tmpdirname | ||
for folder in folder_path.iterdir(): | ||
if folder.is_dir(): | ||
copy2dest(folder, folder_path, input_dir) | ||
|
||
# Run monitor on the temporary folder | ||
monitor(name='dummy_dataset', | ||
data_source=input_dir, | ||
output_dir=output_dir, | ||
decimals=2, | ||
config_path=config_path, | ||
verbose=False, | ||
reference_path='./wpc-6106.xml' | ||
) | ||
copy2dest(output_dir, tmpdirname, '/tmp') | ||
print('simulation-over') | ||
|
||
|
||
run('/home/sinhah/scan_data/WPC-6106') |
Oops, something went wrong.