Skip to content
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

Added script to verify installation #315

Merged
merged 5 commits into from
Feb 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions docs/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ This page contains answers to frequently asked questions about GaNDLF.
- [Table of Contents](#table-of-contents)
- [Why do I get the error `pkg_resources.DistributionNotFound: The 'GANDLF' distribution was not found`?](#why-do-i-get-the-error-pkg_resourcesdistributionnotfound-the-gandlf-distribution-was-not-found)
- [Where do I start?](#where-do-i-start)
- [Why is GaNDLF not working?](#why-is-gandlf-not-working)
- [Which parts of a GaNDLF configuration are customizable?](#which-parts-of-a-gandlf-configuration-are-customizable)
- [Can I run GaNDLF on a high performance computing (HPC) cluster?](#can-i-run-gandlf-on-a-high-performance-computing-hpc-cluster)
- [How can I track the per-epoch training performance?](#how-can-i-track-the-per-epoch-training-performance)
Expand All @@ -25,6 +26,12 @@ The [usage](https://cbica.github.io/GaNDLF/usage) guide is fairly comprehensive

[Back To Top ↑](#table-of-contents)

### Why is GaNDLF not working?

Verify that [the installation](https://cbica.github.io/GaNDLF/setup) has been done correctly by running `python ./gandlf_verifyInstall` after activating the correct virtual environment. If you are still having issues, please feel free to [post a support request](https://github.com/CBICA/GaNDLF/issues/new?assignees=&labels=&template=--questions-help-support.md&title=), and we will do our best to address it ASAP.

[Back To Top ↑](#table-of-contents)

### Which parts of a GaNDLF configuration are customizable?

Virtually all of it! For more details, please see the [usage](https://cbica.github.io/GaNDLF/usage) guide and our extensive [samples](https://github.com/CBICA/GaNDLF/tree/master/samples). All available options are documented in the [config_all_options.yaml file](https://github.com/CBICA/GaNDLF/blob/master/samples/config_all_options.yaml).
Expand Down
2 changes: 1 addition & 1 deletion docs/setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,5 @@ pip install -e .
# conda install -c conda-forge gandlf -y

## verify installation
python -c "import GANDLF as gf;print(gf.__version__)"
python ./gandlf_verifyInstall
```
46 changes: 46 additions & 0 deletions gandlf_verifyInstall
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#!usr/bin/env python
# -*- coding: utf-8 -*-

import os, argparse
from datetime import date


# main function
if __name__ == "__main__":
copyrightMessage = (
"Contact: software@cbica.upenn.edu\n\n"
+ "This program is NOT FDA/CE approved and NOT intended for clinical use.\nCopyright (c) "
+ str(date.today().year)
+ " University of Pennsylvania. All rights reserved."
)

parser = argparse.ArgumentParser(
prog="GANDLF_VerifyInstall",
formatter_class=argparse.RawTextHelpFormatter,
description="Verify GaNDLF installation.\n\n" + copyrightMessage,
)

try:
import GANDLF as gf

print("GaNDLF installed version:", gf.__version__)
except:
raise Exception(
"GaNDLF not properly installed, please see https://cbica.github.io/GaNDLF/setup"
)

try:
import GANDLF.anonymize.dicomanonymizer as anon

if anon:
print("GANDLF's git submodules were successfully imported.")
except:
try:
os.system("git submodule update --init --recursive")
except:
print("Git was not found, please try again.")
os.system("pip install -e .")

args = parser.parse_args()

print("GaNDLF is ready. See https://cbica.github.io/GaNDLF/usage")
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ def run(self):
"gandlf_patchMiner",
"gandlf_preprocess",
"gandlf_anonymizer",
"gandlf_verifyInstall",
],
classifiers=[
"Development Status :: 3 - Alpha",
Expand Down