cutright / IMRT-QA-Data-Miner

Scans a directory for IMRT QA results
MIT License
13 stars 5 forks source link

arccheck.py produces ValueError: {'Minimum': 'n/a', 'Maximum': 'n/a', 'Average': 'n/a', 'Stdv': 'n/a'} is not in list #4

Closed cutright closed 4 years ago

cutright commented 4 years ago

I finally tried out the ArcCheck module and got: ValueError: {'Minimum': 'n/a', 'Maximum': 'n/a', 'Average': 'n/a', 'Stdv': 'n/a'} is not in list

Will post a suggested change momentarily.

cutright commented 4 years ago

I've created a new branch: gh_issue_4

I'd like to propose: https://github.com/cutright/IMRT-QA-Data-Miner/blob/83b5808a67d04356d028c59702a7ac9da4512064/IQDM/parsers/arccheck.py#L73-L78

Previously, it was: https://github.com/cutright/IMRT-QA-Data-Miner/blob/aa19d4ffd0e49961197385c6566f1ff94d70165b/IQDM/parsers/arccheck.py#L73-L83

@mchamberland Does this still work for you? I'll look into why my data doesn't have a Gamma Index Summary... perhaps I should have it look for "Dose Values in cGy"? Based on the attached screenshot, does that make sense?

image

cutright commented 4 years ago

Oh, I see Gamma Index Summary now, I'll keep poking around to see why self.text.index('Gamma Index Summary') crashes on me.

image

mchamberland commented 4 years ago

@cutright Looks okay to me, but I'll give your change a shot tomorrow to make sure.

mchamberland commented 4 years ago

@cutright Although I can read and write Python, I'm not as familiar with packages and setuptools. So, please help me out with testing this commit.

I've checked out the gh_issue_4 branch and, from my local clone, I ran:

python setup.py develop

Then, I cd'ed to a test folder (outside of the IMRT-QA-Data-Miner repo) and typed:

IQDM .

But I get a ModuleNotFoundError for 'parsers'.

Is there anything obvious I'm missing?

cutright commented 4 years ago

I just created a new branch called relative imports (found here on GH). Maybe switch to that branch and try the install again?

This goes back to those relative vs absolute imports. I still don't know the best way. I moved IQDM back to absolute imports since that's easier when running from source code without installing. But when I push to PyPI so people can pip install, I push a different version with the relative imports.

For example, parser.py has the following imports on GitHub

from utilities import are_all_strings_in_text
from parsers.mapcheck import MapcheckReport
from parsers.delta4 import Delta4Report
from parsers.arccheck import ArcCheckReport

versus the following for what I push to PyPI

from ..utilities import are_all_strings_in_text
from .mapcheck import MapcheckReport
from .delta4 import Delta4Report
from .arccheck import ArcCheckReport
mchamberland commented 4 years ago

Ah, I see! Thanks, I'll give that branch a try.

Just for curiosity, what IDE do you use for development?

cutright commented 4 years ago

PyCharm Community Edition

mchamberland commented 4 years ago

I was using PyCharm, then switched to VS Code, but I can't wrap my head around debugging within VS Code! May need to switch back to PyCharm...

mchamberland commented 4 years ago

@cutright In case it helps you, I was able to setup my VS Code to debug the package with the relative imports in place. The trick is to run it as a module, i.e.:

python -m IQDM.main [command line arguments here]

Assuming that you have the main repo in your PYTHONPATH.