Skip to content

Commit

Permalink
debugs
Browse files Browse the repository at this point in the history
  • Loading branch information
CodyCBakerPhD authored Oct 13, 2023
1 parent 6f54acf commit d7cf85e
Showing 1 changed file with 13 additions and 39 deletions.
52 changes: 13 additions & 39 deletions pyflask/manageNeuroconv/manage_neuroconv.py
Original file line number Diff line number Diff line change
Expand Up @@ -528,45 +528,21 @@ def inspect_nwb_file(payload):
from nwbinspector import inspect_nwbfile
from nwbinspector.nwbinspector import InspectorOutputJSONEncoder

return json.loads(
json.dumps(
list(
inspect_nwbfile(
ignore=[
"check_description",
"check_data_orientation",
], # TODO: remove when metadata control is exposed
config="dandi",
**payload,
)
),
cls=InspectorOutputJSONEncoder,
messages = list(
inspect_nwbfile(
ignore=[
"check_description",
"check_data_orientation",
], # TODO: remove when metadata control is exposed
config="dandi",
**payload,
)
)

return json.loads(json.dumps(obj=messages, cls=InspectorOutputJSONEncoder))

def inspect_nwb_file(payload):
from nwbinspector import inspect_nwbfile
from nwbinspector.nwbinspector import InspectorOutputJSONEncoder

return json.loads(
json.dumps(
list(
inspect_nwbfile(
ignore=[
"check_description",
"check_data_orientation",
], # TODO: remove when metadata control is exposed
config="dandi",
**payload,
)
),
cls=InspectorOutputJSONEncoder,
)
)


def _inspect_nwb_folder(payload):
def inspect_nwb_folder(payload):
from nwbinspector import inspect_all
from nwbinspector.nwbinspector import InspectorOutputJSONEncoder

Expand All @@ -582,9 +558,7 @@ def _inspect_nwb_folder(payload):
)
)

# messages = organize_messages(messages, levels=["importance", "message"])

return json.loads(json.dumps(messages, cls=InspectorOutputJSONEncoder))
return json.loads(json.dumps(obj=messages, cls=InspectorOutputJSONEncoder))


def _aggregate_symlinks_in_new_directory(paths, reason="", folder_path=None):
Expand All @@ -597,7 +571,7 @@ def _aggregate_symlinks_in_new_directory(paths, reason="", folder_path=None):
path = Path(path)
new_path = folder_path / path.name
if path.is_dir():
aggregate_symlinks_in_new_directory(
_aggregate_symlinks_in_new_directory(
list(map(lambda name: os.path.join(path, name), os.listdir(path))), None, new_path
)
else:
Expand All @@ -608,6 +582,6 @@ def _aggregate_symlinks_in_new_directory(paths, reason="", folder_path=None):

def inspect_multiple_filesystem_objects(paths):
tmp_folder_path = _aggregate_symlinks_in_new_directory(paths, "inspect")
result = _inspect_nwb_folder({"path": tmp_folder_path})
result = inspect_nwb_folder({"path": tmp_folder_path})
rmtree(tmp_folder_path)
return result

0 comments on commit d7cf85e

Please sign in to comment.