-
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.
Merge pull request #90 from openEOPlatform/fix/list_supported_processes
Fix/list supported processes duplication
- Loading branch information
Showing
2 changed files
with
7 additions
and
8 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,12 @@ | ||
import pkg_resources | ||
|
||
implicitly_supported_processes = ["load_collection", "save_result"] | ||
|
||
def list_supported_processes(): | ||
process_definitions_directory = "javascript_processes" | ||
implicitly_supported_processes = ["load_collection", "save_result", "reduce_dimension", "apply"] | ||
process_definition_files = pkg_resources.resource_listdir("pg_to_evalscript", f"{process_definitions_directory}") | ||
supported_processes_with_files = [ | ||
process_definition_file.replace(".js", "") for process_definition_file in process_definition_files | ||
] | ||
return [*implicitly_supported_processes, *supported_processes_with_files] | ||
unique_supported_processes = list(set([*implicitly_supported_processes, *supported_processes_with_files])) | ||
return unique_supported_processes |
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