Skip to content

Commit

Permalink
Merge pull request #846 from VukW/VukW-deprecated-pkg_resources
Browse files Browse the repository at this point in the history
Deprecated pkg resources
  • Loading branch information
VukW authored Apr 17, 2024
2 parents 36c1da1 + 27e5f92 commit a1f2d5f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
8 changes: 3 additions & 5 deletions GANDLF/config_manager.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
from typing import Optional, Union
import sys, yaml, ast, pkg_resources
import sys, yaml, ast
import numpy as np
from copy import deepcopy

from .utils import version_check
from GANDLF.data.post_process import postprocessing_after_reverse_one_hot_encoding

from GANDLF.metrics import surface_distance_ids
from importlib.metadata import version

## dictionary to define defaults for appropriate options, which are evaluated
parameter_defaults = {
Expand Down Expand Up @@ -127,10 +128,7 @@ def _parseConfig(
assert (
"version" in params
), "The 'version' key needs to be defined in config with 'minimum' and 'maximum' fields to determine the compatibility of configuration with code base"
version_check(
params["version"],
version_to_check=pkg_resources.require("GANDLF")[0].version,
)
version_check(params["version"], version_to_check=version("GANDLF"))

if "patch_size" in params:
# duplicate patch size if it is an int or float
Expand Down
2 changes: 1 addition & 1 deletion docs/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ This page contains answers to frequently asked questions about GaNDLF.

The [usage guide](https://mlcommons.github.io/GaNDLF/usage) provides a good starting point for you to understand the application of GaNDLF. If you have any questions, please feel free to [post a support request](https://github.com/mlcommons/GaNDLF/issues/new?assignees=&labels=&template=--questions-help-support.md&title=), and we will do our best to address it ASAP.

### Why do I get the error `pkg_resources.DistributionNotFound: The 'GANDLF' distribution was not found`?
### Why do I get the error `importlib.metadata.PackageNotFoundError: GANDLF`?

This means that GaNDLF was not installed correctly. Please ensure you have followed the [installation guide](https://mlcommons.github.io/GaNDLF/setup) properly.

Expand Down

0 comments on commit a1f2d5f

Please sign in to comment.