<commit_before>"""
Processes for Species distribution
Author: <NAME> (<EMAIL>)
"""

from flyingpigeon.sdm import _SDMINDICES_

from pywps import Process
from pywps import LiteralInput
from pywps import ComplexInput, ComplexOutput
from pywps import Format, FORMATS
from pywps.app.Common import Metadata
from flyingpigeon.log import init_process_logger


import logging
LOGGER = logging.getLogger("PYWPS")


class SDMgetindicesProcess(Process):
    def __init__(self):
        inputs = [
            ComplexInput('dataset', 'Dataset',
                         abstract="Enter either URL pointing to a NetCDF File"
                                  " or an archive (tar/zip) containing NetCDF files.",
                         min_occurs=1,
                         max_occurs=1000,
                         supported_formats=[
                             Format('application/x-netcdf'),
                             Format('application/x-tar'),
                             Format('application/zip'),
                         ]),

            # ComplexInput('resource', 'Resource',
            #              abstract='NetCDF Files or archive (tar/zip) containing netCDF files.',
            #              metadata=[Metadata('Info')],
            #              min_occurs=1,
            #              max_occurs=1000,
            #              supported_formats=[
            #                  Format('application/x-netcdf'),
            #                  Format('application/x-tar'),
            #                  Format('application/zip'),
            #              ]),

            LiteralInput("input_indices", "Indices",
                         abstract="Climate indices related to growth conditions \
                                    of tree species",
                         default=['TG_JJA', 'TNn_Jan'],
                         data_type='string',
                         min_occurs=1,
                         max_occurs=10,
                         allowed_values=_SDMINDICES_
                         ),

            LiteralInput("archive_format", "Archive format",
                         abstract="Result files will be compressed into archives. \
                                   Choose an appropriate format",
                         default="tar",
                         data_type='string',
                         min_occurs=1,
                         max_occurs=1,
                         allowed_values=['zip', 'tar']
                         )
        ]

        outputs = [
            ComplexOutput("output_indices", "Climate indices for growth conditions over all timesteps",
                          abstract="Archive (tar/zip) containing calculated climate indices",
                          supported_formats=[Format('application/x-tar'),
                                             Format('application/zip')
                                             ],
                          as_reference=True,
                          ),

            ComplexOutput('output_log', 'Logging information',
                          abstract="Collected logs during process run.",
                          as_reference=True,<commit_msg>change default sdm indices simple<commit_after>"""
Processes for Species distribution
Author: <NAME> (<EMAIL>)
"""

from flyingpigeon.sdm import _SDMINDICES_

from pywps import Process
from pywps import LiteralInput
from pywps import ComplexInput, ComplexOutput
from pywps import Format, FORMATS
from pywps.app.Common import Metadata
from flyingpigeon.log import init_process_logger


import logging
LOGGER = logging.getLogger("PYWPS")


class SDMgetindicesProcess(Process):
    def __init__(self):
        inputs = [
            ComplexInput('dataset', 'Dataset',
                         abstract="Enter either URL pointing to a NetCDF File"
                                  " or an archive (tar/zip) containing NetCDF files.",
                         min_occurs=1,
                         max_occurs=1000,
                         supported_formats=[
                             Format('application/x-netcdf'),
                             Format('application/x-tar'),
                             Format('application/zip'),
                         ]),

            # ComplexInput('resource', 'Resource',
            #              abstract='NetCDF Files or archive (tar/zip) containing netCDF files.',
            #              metadata=[Metadata('Info')],
            #              min_occurs=1,
            #              max_occurs=1000,
            #              supported_formats=[
            #                  Format('application/x-netcdf'),
            #                  Format('application/x-tar'),
            #                  Format('application/zip'),
            #              ]),

            LiteralInput("input_indices", "Indices",
                         abstract="Climate indices related to growth conditions \
                                    of tree species",
                         default='TG_JJA',
                         data_type='string',
                         min_occurs=1,
                         max_occurs=10,
                         allowed_values=_SDMINDICES_
                         ),

            LiteralInput("archive_format", "Archive format",
                         abstract="Result files will be compressed into archives. \
                                   Choose an appropriate format",
                         default="tar",
                         data_type='string',
                         min_occurs=1,
                         max_occurs=1,
                         allowed_values=['zip', 'tar']
                         )
        ]

        outputs = [
            ComplexOutput("output_indices", "Climate indices for growth conditions over all timesteps",
                          abstract="Archive (tar/zip) containing calculated climate indices",
                          supported_formats=[Format('application/x-tar'),
                                             Format('application/zip')
                                             ],
                          as_reference=True,
                          ),

            ComplexOutput('output_log', 'Logging information',
                          abstract="Collected logs during process run.",
                          as_reference=True,
{'fraction_non_alphanumeric': 0.0813020915238245, 'fraction_numerical': 0.004717722912407611, 'mean_word_length': 1.1676891615541922, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 16, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5655438', 'n_tokens_mistral': 1418, 'n_tokens_neox': 1324, 'n_words': 306}