Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit eb1e7d9

Browse files
authored
[contrib-sparsity] use os.getenv for simplicity (#1933)
1 parent 4fd4f30 commit eb1e7d9

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

apex/contrib/sparsity/permutation_search_kernels/exhaustive_search.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,14 +60,11 @@ def generate_unique_combinations(built_permutation, remaining_columns, full_perm
6060
remaining_columns.insert(c, built_permutation.pop(-1))
6161

6262
import os
63-
from os import environ, path
63+
from os import path
6464
unique_permutation_list = {}
6565
def generate_all_unique_combinations(C, M, must_use_all_groups = False):
6666

67-
cache_dir_path = ASP_CACHE_DIR_DEFAULT
68-
# The user is allowed to set the cache directory via an environment variable.
69-
if environ.get(ASP_CACHE_DIR_ENV_VAR) is not None:
70-
cache_dir_path = environ.get(ASP_CACHE_DIR_ENV_VAR)
67+
cache_dir_path = os.getenv(ASP_CACHE_DIR_ENV_VAR, ASP_CACHE_DIR_DEFAULT)
7168
cache_file_path = path.join(cache_dir_path, f"permutations_{C}_{M}.npy")
7269

7370
global unique_permutation_list

0 commit comments

Comments
 (0)