-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a25d6c5
commit a13ac1e
Showing
6 changed files
with
204 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# flake8: noqa | ||
from scriptcontext import sticky as st | ||
from Grasshopper.Kernel.GH_RuntimeMessageLevel import Error, Warning | ||
|
||
from aixd_ara.gh_ui import merge_datasets | ||
from aixd_ara.gh_ui_helper import clear_sticky | ||
from aixd_ara.gh_ui_helper import component_id | ||
from aixd_ara.gh_ui_helper import session_id | ||
|
||
if samples_per_file is None: samples_per_file = 1000 | ||
assert samples_per_file>0, "samples_per_file must be a positive integer, got {}".format(samples_per_file) | ||
|
||
if root_folder: | ||
cid = component_id(session_id(), ghenv.Component, "ProjectSetup") | ||
|
||
if merge: | ||
st[cid] = merge_datasets(session_id(), root_folder, new_dataset_name,samples_per_file) | ||
|
||
if cid in st.keys(): | ||
status = st[cid]["status"] | ||
msg = st[cid]["msg"] | ||
# if status=="error": | ||
# ghenv.Component.AddRuntimeMessage(Error, msg) | ||
# elif status=="warning": | ||
# ghenv.Component.AddRuntimeMessage(Warning, msg) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
{ | ||
"name": "DatasetsMerge", | ||
"nickname": "DatasetsMerge", | ||
"category": "ARA", | ||
"subcategory": "2 Dataset", | ||
"description": "Merges multiple datasets into a single dataset. Requires that the datasets have the same schema (variable names, types, dimensions).", | ||
"exposure": 2, | ||
"ghpython": { | ||
"isAdvancedMode": false, | ||
"iconDisplay": 0, | ||
"inputParameters": [ | ||
{ | ||
"name": "root_folder", | ||
"description": "Path to the folder containing the datasets to merge.", | ||
"typeHintID": "str", | ||
"scriptParamAccess": 0 | ||
}, | ||
{ | ||
"name": "new_dataset_name", | ||
"description": "Name of the merged dataset. (Optional, default: 'merged_dataset'.)", | ||
"typeHintID": "str", | ||
"scriptParamAccess": 0 | ||
}, | ||
{ | ||
"name": "samples_per_file", | ||
"description": "Number of samples to be saved in each file of the new dataset. (Optional, default: 1000.)", | ||
"typeHintID": "int", | ||
"scriptParamAccess": 0 | ||
}, | ||
{ | ||
"name": "merge", | ||
"description": "Triggers the merge process.", | ||
"typeHintID": "bool", | ||
"scriptParamAccess": 0 | ||
} | ||
], | ||
|
||
"outputParameters": [ | ||
{ | ||
"name": "msg", | ||
"description": "Message logs." | ||
} | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters