Skip to content

Commit

Permalink
Change pc style for module description for importer and exporter in m…
Browse files Browse the repository at this point in the history
…odule plugin (#387)

* change pc style for module description for importer and exporter in module plugin

* black
  • Loading branch information
juleshaas authored Oct 21, 2022
1 parent c244316 commit 9e7581d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 13 deletions.
9 changes: 5 additions & 4 deletions src/actinia_core/core/common/process_chain.py
Original file line number Diff line number Diff line change
Expand Up @@ -590,10 +590,10 @@ def generate_temp_file_path(self):
)

def _create_module_process(self, module_descr):
"""Analyse a grass process description dict and create a Process
"""Analyse a grass process description dict and create a process
that is used to execute a GRASS GIS binary.
- Identify the required mapsets from the input definition and stores
- Identify the required mapsets from the input definition and store
them in a list.
- Identify input and output options
- Add export options to the export list
Expand Down Expand Up @@ -675,7 +675,9 @@ def _create_module_process(self, module_descr):
"parameters for %s" % module_name
)

if module_name != "importer" and module_name != "exporter":
if (
module_name != "importer" and module_name != "exporter"
) or params == ["--interface-description"]:
p = Process(
exec_type="grass",
executable=module_name,
Expand All @@ -685,7 +687,6 @@ def _create_module_process(self, module_descr):
)

self.process_dict[id] = p

return p

return None
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,10 @@


class EphemeralProcessing(object):
"""
This class processes GRASS data on the local machine in an temporary
"""This class processes GRASS data on the local machine in a temporary
mapset.
The temporary mapset will be removed by this class when the processing
The temporary mapset will be removed by this class when the processing is
finished
Creating the temporary database and mapset:
Expand All @@ -92,7 +91,7 @@ class EphemeralProcessing(object):
e.g: /tmp/soeren_temp_gisdbase/ECAD
3. Softlink the PERMANENT and all required mapsets into the,
3. Softlink the PERMANENT and all required mapsets into the
new location directory from the original location,
check the input parameter of the module for which mapsets must be linked
Expand All @@ -102,7 +101,7 @@ class EphemeralProcessing(object):
-> /tmp/soeren_temp_gisdbase/ECAD/Temperature
4. Set the GRASS GIS environmental variables to point to the new gisdbase,
location and PERMANENT maspet
location and PERMANENT mapset
5. Create a new mapset with g.mapset in the temporary location directory
Expand Down Expand Up @@ -470,8 +469,9 @@ def _send_to_database(self, document, final=False):

def _post_to_webhook(self, document, type):
"""Helper method to send a post request to a webhook.
The finished webhook will be retried until it is reached of the number
of tries is WEBHOOK_RETRIES which can be set in the config.
The finished webhook will be retried until it has reached the number
of tries. The number of tries is WEBHOOK_RETRIES which can be set in the
config.
Args:
document (str): The response document
Expand Down Expand Up @@ -698,7 +698,7 @@ def _setup(self, init_grass=True):
- Create the resource and message logger
- Create the redis lock interface for resource locking
- Set cell limit, process number limit and process time limit from user
c redentials.
credentials.
- Create all required paths to original and temporary location and
mapsets.
- temp_location_path
Expand Down Expand Up @@ -1887,7 +1887,7 @@ def _final_cleanup(self):

def run(self):
"""This function will run the processing and will catch and process
any Exceptions that were raised while processing. Call this function to
any exceptions that were raised while processing. Call this function to
run the processing.
You have to implement/overwrite two methods that are called here:
Expand Down

0 comments on commit 9e7581d

Please sign in to comment.