Skip to content

Commit

Permalink
fix style in code (#722)
Browse files Browse the repository at this point in the history
  • Loading branch information
jdkent authored Feb 29, 2024
1 parent 49b4faf commit 90bfd73
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 21 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -119,3 +119,6 @@ doc/generated/

# Pytest
.pytest_cache/

# all dot directories
.*/
39 changes: 19 additions & 20 deletions compose/neurosynth-frontend/scripts/parse_nimare_docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,14 @@
NIMARE_IMAGE_ALGORITHMS = [
cls
for cls in inspect.getmembers(niimgs, inspect.isclass)
if cls[0] not in [
if cls[0]
not in [
"NiftiMasker",
"MetaEstimator",
"Memory",
"Estimator",
"IBMAEstimator",
"Memory"
"Memory",
]
]

Expand All @@ -45,9 +46,7 @@
"SCALE": "ALEKernel",
}

BLACKLIST_ALGORITHMS = [
"SCALE"
]
BLACKLIST_ALGORITHMS = ["SCALE"]

BLACKLIST_PARAMS = [
"n_cores",
Expand Down Expand Up @@ -81,9 +80,7 @@ def _derive_type(type_name):


def _derive_default(class_signature, param):
default = getattr(
cls_signature.parameters.get(param.name), "default", None
)
default = getattr(cls_signature.parameters.get(param.name), "default", None)
if isinstance(default, tuple):
default = default[0]

Expand Down Expand Up @@ -124,16 +121,16 @@ def _derive_default(class_signature, param):

def _check_fwe(cls):
# Check if the method exists
has_method = hasattr(cls, 'correct_fwe_montecarlo')
has_method = hasattr(cls, "correct_fwe_montecarlo")
if has_method:
# Get the method
method = getattr(cls, 'correct_fwe_montecarlo')
method = getattr(cls, "correct_fwe_montecarlo")

# Get the source code of the method
source_code = inspect.getsource(method)

# Check if the source code contains 'NotImplementedError'
fwe_enabled = 'NotImplementedError' not in source_code
fwe_enabled = "NotImplementedError" not in source_code
else:
fwe_enabled = False

Expand All @@ -145,15 +142,17 @@ def _check_fwe(cls):
mdocs = FunctionDoc(method)

# Get the default parameters of the method
method_default_parameters = {
param.name: {
"description": " ".join(param.desc),
"type": _derive_type(param.type)[0] or None,
"default": _derive_default(method_signature, param),
}
for param in mdocs._parsed_data["Parameters"]
if param.name not in BLACKLIST_PARAMS
},
method_default_parameters = (
{
param.name: {
"description": " ".join(param.desc),
"type": _derive_type(param.type)[0] or None,
"default": _derive_default(method_signature, param),
}
for param in mdocs._parsed_data["Parameters"]
if param.name not in BLACKLIST_PARAMS
},
)

if isinstance(method_default_parameters, tuple):
method_default_parameters = method_default_parameters[0]
Expand Down
4 changes: 3 additions & 1 deletion compose/scripts/add_usernames.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
TOKEN = "INSERT TOKEN"


user_endpoint = Users(domain=current_app.config["AUTH0_BASE_URL"].removeprefix("https://"), token=TOKEN)
user_endpoint = Users(
domain=current_app.config["AUTH0_BASE_URL"].removeprefix("https://"), token=TOKEN
)

result = user_endpoint.list(per_page=100)["users"]

Expand Down

0 comments on commit 90bfd73

Please sign in to comment.