-
Notifications
You must be signed in to change notification settings - Fork 12
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
Feat/qupath #209
Feat/qupath #209
Conversation
@kaczmarj I believe the pytorch test is failing because I'm importing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks great @swaradgat19 ! i left a few requests for changes but overall, really great. thanks
flake8 is complaining:
|
@kaczmarj Instead of type def add_image_and_geojson(
qupath_proj: object,
*,
image_path: Path | str,
geojson_path: Path | str,
) -> None:
# rest of the code It is not recognizing QuPathProject inside Do you think this would be a good idea? |
i suggest we remove the type, so it's |
@kaczmarj I believe not specifying a type is causing an issue:
This was in the styles ci test |
i see... so instead of importing try:
from paquo.projects import QuPathProject
HAS_PAQUO = True
except Exception:
HAS_PAQUO = False and in the command-line interface, if the user passes |
Sure. So I'm setting the HAS_PAQUO variable globally like you suggested. Inside the make_qupath_project function, I'm doing the following: def make_qupath_project(wsi_dir: Path, results_dir: Path) -> None:
if not HAS_PAQUO:
print(
"""Cannot find QuPath.
QuPath is required to use this functionality but it cannot be found.
If QuPath is installed, please use define the environment variable
PAQUO_QUPATH_DIR with the location of the QuPath installation.
If QuPath is not installed, please install it from https://qupath.github.io/."""
)
sys.exit(1)
else:
print("Found QuPath successfully!")
QUPATH_PROJECT_DIRECTORY = results_dir / "model-outputs-qupath"
# add image and geojson using paquo |
that looks good. feel free to push a commit with the changes |
I think its failing because even though the paquo import is global, I'm specifically calling the For example: if qupath:
#handle paquo import using try-except and if successful, call make_qupath_project function
make_qupath_project(wsi_dir, results_dir) |
here are the errors. we will have to add the other type errors seem to be new and i think unrelated to this pull request. let me work on fixing those in a separate branch. once i make the fix and i merge it into main, i will ask you to merge main into your branch. wsinfer/qupath.py:8: error: Cannot find implementation or library stub for module named "paquo.projects" [import-not-found]
wsinfer/qupath.py:8: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports
wsinfer/patchlib/patch.py:56: error: Incompatible types in assignment (expression has type "Mat | ndarray[Any, dtype[generic]]", variable has type "ndarray[Any, dtype[signedinteger[Any]]]") [assignment]
wsinfer/patchlib/patch.py:68: error: Unsupported operand types for * ("ndarray[Any, dtype[generic]]" and "ndarray[Any, dtype[floating[Any]]]") [operator]
wsinfer/patchlib/patch.py:118: error: Incompatible return value type (got "tuple[Any, Sequence[ndarray[Any, dtype[generic]]], ndarray[Any, dtype[signedinteger[Any]]]]", expected "tuple[Any, Sequence[ndarray[Any, dtype[signedinteger[Any]]]], ndarray[Any, dtype[signedinteger[Any]]]]") [return-value]
wsinfer/patchlib/segment.py:50: error: Incompatible types in assignment (expression has type "ndarray[Any, dtype[generic]]", variable has type "ndarray[Any, dtype[unsignedinteger[_8Bit]]]") [assignment]
wsinfer/patchlib/segment.py:63: error: Incompatible types in assignment (expression has type "ndarray[Any, dtype[generic]]", variable has type "ndarray[Any, dtype[unsignedinteger[_8Bit]]]") [assignment]
wsinfer/patchlib/segment.py:66: error: Incompatible types in assignment (expression has type "Mat | ndarray[Any, dtype[generic]]", variable has type "ndarray[Any, dtype[unsignedinteger[_8Bit]]]") [assignment] |
@swaradgat19 - i merged main into your branch |
now the remaining errors are wsinfer/qupath.py:8: error: Cannot find implementation or library stub for module named "paquo.projects" [import-not-found]
wsinfer/qupath.py:8: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports to fix that, look at pyproject.toml. there should be a section where we tell mypy what to ignore. add paquo.* there |
I'm currently ignoring the Sorry for the unnecessary commits! |
make try:
from paquo.projects import QuPathProject
HAS_PAQUO = True
except Exception:
HAS_PAQUO = False top-level in then, use also remove the |
My bad. I changed it because a global import wasn't working and I was running into issues. The issue was somewhere else. Changing it. |
Looks good! Should I work on the tests for this feature as well? |
great! i merged it into main. thanks very much @swaradgat19 !
yes, that would be great |
So I'm thinking of modifying the |
I would make a dedicated new test. You can also skip the test is HAS_PAQUO is false. Pytest has a skipif decorator for this. Best,JakubOn Jan 5, 2024, at 17:30, Swarad Gat ***@***.***> wrote:
So I'm thinking of modifying the test_cli_run_with_registered_models test with additional the qupath argument. Should I instead make a new test?
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you modified the open/close state.Message ID: ***@***.***>
|
No description provided.