# Evaluate this cell to identifiy your form 

from dkrz_forms import form_widgets, form_handler, checks
form_infos = form_widgets.show_selection()

# Evaluate this cell to generate your personal form instance

form_info = form_infos[form_widgets.FORMS.value]
sf = form_handler.init_form(form_info)
form = sf.sub.entity_out.report

"""
Explanation: Generic DKRZ CMIP Data Pool (CDP) ingest form

This form is intended to request data to be made locally available in the DKRZ national data archive.
If the requested data is available via ESGF please use the specific ESGF replication form.
Please provide information on the following aspects of your data ingest request:
* scientific context of data
* data access policies to be supported
* technical details, like
   * amount of data
   * source of data
Please identify your form
this step is necessary to uniquely correlate this form to you (e.g. your email address)
please make sure the name shown on the top of this page matches your selection below
End of explanation
"""


# (informal) type of data
form.data_type = "...."  # e.g. model data, observational data, .. 

# free text describing scientific context of data
form.scientific_context ="..." 

# free text describing the expected usage as part of the DKRZ CMIP Data pool
form.usage = "...." 

# free text describing access rights (who is allowed to read the data)
form.access_rights = "...."

# generic terms of  policy information
form.terms_of_use = "...." # e.g. unrestricted, restricted

# any additional comment on context
form.access_group = "...."
form.context_comment = "...."

"""
Explanation: some context information
Please provide some generic context information about the data, which should be availabe as part of the DKRZ CMIP Data Pool (CDP)
End of explanation
"""


# information on where the data is stored and can be accessed
# e.g. file system path if on DKRZ storage, url etc. if on web accessible resources (cloud,thredds server,..)
form.data_path = "...."

# timing constraints, when the data ingest should be completed 
# (e.g. because the data source is only accessible in specific time frame)  
form.best_ingest_before = "...."

# directory structure information, especially 
form.directory_structure = "..."  # e.g. institute/experiment/file.nc
form.directory_structure_convention = "..." # e.g. CMIP5, CMIP6, CORDEX, your_convention_name
form.directory_structure_comment = "..."  # free text, e.g. with link describing the directory structure convention you used

# metadata information
form.metadata_convention_name = "..." # e.g. CF1.6 etc. None if not applicable
form.metadata_comment = "..." # information about metadata, e.g. links to metadata info etc. 

"""
Explanation: technical information concerning your request
End of explanation
"""


# to be completed .. 
report = checks.check_report(sf,"sub")
checks.display_report(report)

"""
Explanation: Check your submission form
Please evaluate the following cell to check your submission form.
In case of errors, please go up to the corresponden information cells and update your information accordingly...
End of explanation
"""


form_handler.save_form(sf,"..my comment..") # edit my comment info 

"""
Explanation: Save your form
your form will be stored (the form name consists of your last name plut your keyword)
End of explanation
"""


form_handler.form_submission(sf)

"""
Explanation: officially submit your form
the form will be submitted to the DKRZ team to process
you also receive a confirmation email with a reference to your online form for future modifications
End of explanation
"""


