Facility Modules (Generic)¶
hedwig.facility.generic.tool_avail¶
- class hedwig.facility.generic.tool_avail.AvailabilityTool(*args, **kwargs)¶
- classmethod get_code()¶
Get the target tool code.
- get_name()¶
Get the target tool name.
- get_default_facility_code()¶
Get the code of the facility for which this target tool is designed.
- _view_proposal(current_user, db, proposal, target_objects, extra_info, args, auth_cache)¶
Prepare extra template context for target tool in “proposal” mode.
Target tool sub-classes should override this method if they need to behave differently in different modes — otherwise they need only override _view_any_mode.
- Returns:
template context dictionary
- _view_any_mode(current_user, db, target_objects, extra_info, args, form, auth_cache)¶
Prepare extra template context for target tool in any mode.
Target tool sub-classes should override this method to implement the analysis routine which the tool is intended to perform.
If the tool needs to behave differently in different modes it can override the specific mode protected methods instead.
- Parameters:
db – database access object
target_object – list of TargetObject instances
args – HTTP arguments
form – HTTP form or None if not a POST request
- Returns:
template context dictionary
- _do_availability_search(target_objects, date_start, date_end)¶
- _view_extra_info(args, form)¶
Read the start and end date from the form.
hedwig.facility.generic.tool_clash¶
- class hedwig.facility.generic.tool_clash.TargetClash(target, mocs, target_links)¶
- _asdict()¶
Return a new dict which maps field names to their values.
- _field_defaults = {}¶
- _fields = ('target', 'mocs', 'target_links')¶
- classmethod _make(iterable)¶
Make a new TargetClash object from a sequence or iterable
- _replace(**kwds)¶
Return a new TargetClash object replacing specified fields with new values
- mocs¶
Alias for field number 1
- target¶
Alias for field number 0
- target_links¶
Alias for field number 2
- class hedwig.facility.generic.tool_clash.ClashTool(*args, **kwargs)¶
- proposal_message_error = False¶
- classmethod get_code()¶
Get the target tool “code”.
- get_name()¶
Get the target tool’s name.
- get_default_facility_code()¶
Get the code of the facility for which this target tool is designed.
- get_custom_routes()¶
Get list of custom routes used by the clash tool.
- _view_any_mode(current_user, db, target_objects, extra_info, args, form, auth_cache)¶
Prepare clash tool template context for all tool modes.
This performs a MOC search if the target_objects list is not None.
- _view_extra_info(args, form)¶
Read clash tool-specific information from the query arguments or form.
- _determine_public_constraint(current_user, db, auth_cache=None)¶
Determine the database search constraint we should use on the public field.
The constraint should be that the public flag is true, unless the user has access to private mocs.
- _do_moc_search(db, targets, public, radius)¶
Search the coverage maps (MOCs) for the given list of targets.
Iterates over the list of targets and converts each to a set of HEALPix cells at the facility’s specified MOC order. Then searches the MOC cell database table to determine whether the target clashes or not.
- Parameters:
db – database access object
targets – list of targets
public – database MOC search “public” constraint as determined by
_determine_public_constraint()radius – search radius (arcseconds)
- Returns:
tuple of lists (clashes, non_clashes) where each entry is a TargetClash tuple
- view_moc_list(current_user, db)¶
View handler for MOC listing custom route.
- view_moc_info(current_user, db, moc_id)¶
View handler for MOC info custom route.
- view_moc_fits(current_user, db, moc_id)¶
View handler for MOC FITS download custom route.
- view_moc_edit(current_user, db, moc_id, form, file_)¶
- view_moc_delete(current_user, db, moc_id, form)¶
- search_between_proposals(current_user, db, proposals, args, form)¶
- search_proposal_pair(current_user, db, proposals, args)¶
hedwig.facility.generic.view¶
- class hedwig.facility.generic.view.Generic(id_)¶
Base class for Facility objects.
- classmethod get_code()¶
Get the facility “code”.
This is a short string to uniquely identify the facility. It will correspond to an entry in the “facility” table.
- get_name()¶
Get the name of the facility.
- get_definite_name()¶
Get the name of the facility, with a definate article for use in a sentence, if one would be appropriate.
e.g. “the JCMT” or “UKIRT”.
Subclasses should override this method if they do not want the word “the” to appear.
- get_calculator_classes()¶
Get a tuple of calculator classes which can be used with this facility.
Sub-classes should override this method to provide the correct list of calculators.
- get_moc_order()¶
Get the MOC order at which MOCs should be stored for this facility.
The higher the order of the MOC, the more precise it becomes, but with an associated increase in storage space and search time.
An appropriate value should be given here. It is important that the value is not reduced once MOCs have already been stored. That would cause there to be orders in the database higher than the current level and any cells in those orders would not be found in subsequent cell searches.
- get_target_tool_classes()¶
Get a tuple of the target tool classes which can be used with this facility.
- get_affiliation_types()¶
Get the affiliation type enum-style class to be used with this facility.
- get_call_types()¶
Get the call type enum-style class to be used with this facility.
- get_text_roles()¶
Get the text roles enum-style class to be used with this facility.
- get_reviewer_roles()¶
Get the reviewer roles enum-style class to be used with this facility.
- get_custom_filters()¶
Return list of custom template filter functions.
These will be registed with the web application with their names prefixed with the facility code and an underscore.
- get_custom_routes()¶
Return list of custom routes required for this facility.
Note that the route information will automatically be prefixed as follows:
template: <facility code>/
- Returns:
a list of RouteInfo tuples
- get_new_call_default(type_)¶
Get the default parameters for a new call.
This method is used to determine the default call parameters used to populate the “new call” page when it is first displayed.
- get_proposal_order(type_=None)¶
Get a list of proposal sections in the order in which they should be shown.
- get_proposal_order_names(type_=None)¶
Get an ordered dictionary which maps proposal section codes to their names, in the order in which they should be shown.
- get_observing_info()¶
Get observing information.
- make_proposal_code(db, proposal)¶
Generate the proposal identifying code for a given proposal.
This should be overridden by sub-classes to apply the naming scheme in use at each facility.
- parse_proposal_code(db, proposal_code)¶
Attempt to convert a proposal code into a proposal identifier.
This is done by parsing the code and then attempting to look it up in the database to get the identifier number.
- Raises:
ParseError – if the proposal code is not understood.
NoSuchRecord – if the proposal code is understood, but no matching record is found in the database.
- _parse_proposal_code(proposal_code)¶
Perform the parsing step of processing a proposal code.
This splits the code into the semester code, queue code, call type and proposal number.
- make_archive_search_urls(coord, public=True)¶
Make URLs to the facility’s archive search pages for the given coordinates.
- Parameters:
coord – coordinates as an astropy SkyCoord object in ICRS.
public – True if only publicly accessible links should be given, e.g. when the Clash Tool performs a search as a user unable to view private MOCs.
- Returns:
list of Link namedtuple instances with “text” and “url” attributes.
- make_proposal_info_urls(proposal_code)¶
Make a list of URLs (“Link” namedtuple instances with “text” and “url” attributes) which link to more information about a proposal.
This is used, for example, for the list of previous proposals which have been entered by a proposal author.
- make_review_guidelines_url(role)¶
Make an URL for guidelines to be sent to reviewers.
Returns None if there is no suitable URL defined.
- calculate_overall_rating(reviews, with_std_dev=False)¶
Calculate the overall rating from a collection of reviewer records (including their reviews).
- get_review_rating_weight_function()¶
Get the numerical rating and weight of a review.
- Returns:
a (rating, weight) tuple. If either value is None then the review should not be included in the overall rating.
- calculate_affiliation_assignment(db, members, affiliations)¶
Calculate the fractional affiliation assignment for the members of a proposal.
Takes a collection of affiliations and returns a dictionary of fractional affiliation assignment for each affiliation identifier in the given collection. A special identifier of zero is used for any affiliations which don’t appear in the given collection.
Note: this is a simple example implementation which just counts the members of each affiliation (skipping those where the affiliation type is not “STANDARD”) and ignoring the affiliation weight values.
Each facility will need to override this method with a method implementing its own actual assignment rules.
- attach_review_extra(db, proposals)¶
Get additional review information from the database.
Placeholder method for facility-specific review information retrieval method.
The reviewer records attached to each of the proposals in the given collection should be modified as appropriate.
- get_feedback_extra(db, proposal)¶
Get additional context to include in the proposal feedback email message.
This message informs the proposal members whether the proposal was accepted or rejected at the end of the review processes. Each facility should override this method to supply additional information (such as the time allocated) to its own template for the feedback message.
hedwig.facility.generic.view_admin¶
- class hedwig.facility.generic.view_admin.GenericAdmin¶
- view_facility_admin(current_user, db)¶
- view_semester_list(current_user, db)¶
- view_semester_view(current_user, db, semester_id)¶
- view_semester_edit(current_user, db, semester_id, args, form)¶
Edit or create a new semester.
If the “semester_id” parameter is None, then a new semester will be created. Otherwise the existing semester will be updated.
- view_call_preamble_edit(current_user, db, semester_id, call_type, form)¶
- view_queue_list(current_user, db)¶
- view_queue_view(current_user, db, queue_id)¶
- view_queue_edit(current_user, db, queue_id, form)¶
Edit or create a new queue.
- view_call_list(current_user, db)¶
- view_call_view(current_user, db, call_id)¶
- _view_call_extra(db, call)¶
- view_call_edit(current_user, db, call_id, call_type, args, form)¶
Create or edit a call.
- _view_call_edit_copy(db, call)¶
- _view_call_edit_get(db, call, form)¶
- _view_call_edit_save(db, call, info)¶
- _view_call_edit_extra(db, call, info)¶
- view_call_mid_close(current_user, db, call_id, form)¶
Edit a call’s intermediate close dates.
- view_call_proposals(current_user, db, call_id)¶
- view_affiliation_edit(current_user, db, queue_id, form)¶
- view_group_view(current_user, db, queue_id, group_type)¶
- view_group_member_add(current_user, db, queue_id, group_type, form)¶
- _message_group_invite(current_user, db, group_info, queue, person_id, person_name)¶
- view_group_member_edit(current_user, db, queue_id, group_type, form)¶
- view_group_member_reinvite(current_user, db, queue_id, group_type, member_id, form)¶
- view_category_edit(current_user, db, form)¶
hedwig.facility.generic.view_home¶
hedwig.facility.generic.view_proposal¶
- class hedwig.facility.generic.view_proposal.CalculationExtra(calculator_name, inputs, outputs, mode_info)¶
- _asdict()¶
Return a new dict which maps field names to their values.
- _field_defaults = {}¶
- _fields = ('calculator_name', 'inputs', 'outputs', 'mode_info')¶
- classmethod _make(iterable)¶
Make a new CalculationExtra object from a sequence or iterable
- _replace(**kwds)¶
Return a new CalculationExtra object replacing specified fields with new values
- calculator_name¶
Alias for field number 0
- inputs¶
Alias for field number 1
- mode_info¶
Alias for field number 3
- outputs¶
Alias for field number 2
- class hedwig.facility.generic.view_proposal.PrevProposalExtra(proposal_state, proposal_type, proposal_call_id, proposal_call_type, proposal_semester_id, proposal_queue_id, publications, links, can_view_proposal, can_view_review)¶
- _asdict()¶
Return a new dict which maps field names to their values.
- _field_defaults = {}¶
- _fields = ('proposal_state', 'proposal_type', 'proposal_call_id', 'proposal_call_type', 'proposal_semester_id', 'proposal_queue_id', 'publications', 'links', 'can_view_proposal', 'can_view_review')¶
- classmethod _make(iterable)¶
Make a new PrevProposalExtra object from a sequence or iterable
- _replace(**kwds)¶
Return a new PrevProposalExtra object replacing specified fields with new values
- can_view_proposal¶
Alias for field number 8
- can_view_review¶
Alias for field number 9
- links¶
Alias for field number 7
- proposal_call_id¶
Alias for field number 2
- proposal_call_type¶
Alias for field number 3
- proposal_queue_id¶
Alias for field number 5
- proposal_semester_id¶
Alias for field number 4
- proposal_state¶
Alias for field number 0
- proposal_type¶
Alias for field number 1
- publications¶
Alias for field number 6
- class hedwig.facility.generic.view_proposal.PrevProposalPubExtra(proposal_id, url)¶
- _asdict()¶
Return a new dict which maps field names to their values.
- _field_defaults = {}¶
- _fields = ('proposal_id', 'url')¶
- classmethod _make(iterable)¶
Make a new PrevProposalPubExtra object from a sequence or iterable
- _replace(**kwds)¶
Return a new PrevProposalPubExtra object replacing specified fields with new values
- proposal_id¶
Alias for field number 0
- url¶
Alias for field number 1
- class hedwig.facility.generic.view_proposal.GenericProposal¶
- view_proposal_new(current_user, db, call_id, form)¶
- view_proposal_copy_request_status(current_user, db, proposal, can, request_id)¶
- view_proposal_copy_request_query(current_user, db, proposal, can, request_id)¶
- _get_proposal_copy_request_dynamic(request)¶
- _copy_proposal(current_user, db, old_proposal, proposal, copy_members, extra_text_roles=[])¶
- _copy_proposal_annotation(current_user, old_proposal, old_proposal_code)¶
- _copy_proposal_members(notes, current_user, db, old_proposal, old_proposal_code, proposal, copy_members=False)¶
- _copy_proposal_previous(notes, current_user, db, old_proposal, old_proposal_code, proposal, is_continuation=False)¶
- _continue_proposal(current_user, db, old_proposal, proposal)¶
- view_proposal_view(current_user, db, proposal, can, args)¶
- _view_proposal_extra(current_user, db, proposal, extra_text_roles={}, auth_cache=None)¶
Method to gather additional information for the proposal view page.
Sub-classes can override this method to add additional information to the proposal.
- view_proposal_sections(current_user, db, *args, **kwargs)¶
Method to view a proposal as a series of sections.
This calls the view_proposal_view method and then splits up the proposal into separate sections, each of which is either a template context (with restricted proposal_order selection) or a PDF file. Then a complete proposal can be generated by applying the templates and concatenating the resulting sections.
- view_proposal_alter_state(current_user, db, proposal, form)¶
- _validate_proposal(current_user, db, proposal, proposal_order, auth_cache)¶
- _validate_proposal_extra(db, proposal, extra, proposal_order, skip_missing_targets=False, check_excluded_pi=False)¶
- view_proposal_submit(current_user, db, proposal, can, form)¶
- _message_proposal_submit(current_user, db, proposal)¶
- _message_proposal_review_notification(db, proposal)¶
Send message to notify committee members about a proposal having been submitted, perhaps for immediate review.
- Parameters:
db – database control object.
proposal – the Proposal object.
- view_proposal_validate(current_user, db, proposal, can)¶
- view_proposal_withdraw(current_user, db, proposal, can, form)¶
- _message_proposal_withdraw(current_user, db, proposal)¶
- view_title_edit(current_user, db, proposal, can, form)¶
- view_abstract_edit(current_user, db, proposal, can, form)¶
- _view_abstract_edit_init(db, proposal, role)¶
- _view_abstract_edit_read(db, proposal, role, form, ctx)¶
- _view_abstract_edit_proc(db, proposal, role, ctx)¶
- view_member_edit(current_user, db, proposal, can, form)¶
- view_member_add(current_user, db, proposal, can, form)¶
- _message_proposal_invite(current_user, db, proposal, person_id, person_name, is_editor, affiliation_name, send_token, copy_proposal_code=None)¶
- view_member_reinvite(current_user, db, proposal, can, member_id, form)¶
- view_member_remove_self(current_user, db, proposal, can, form)¶
- view_student_edit(current_user, db, proposal, can, form)¶
- view_member_affiliation_edit(current_user, db, proposal, member_id, form)¶
- view_member_institution_edit(current_user, db, proposal, member_id, form)¶
- view_previous_edit(current_user, db, proposal, can, form)¶
- view_target_edit(current_user, db, proposal, can, form)¶
- view_target_upload(current_user, db, proposal, can, form, file_)¶
- view_target_download(current_user, db, proposal, can)¶
- view_tool_note_edit(current_user, db, proposal, can, form)¶
- _view_tool_note_edit_init(db, proposal, role)¶
- view_request_edit(current_user, db, proposal, can, form)¶
- view_case_edit(current_user, db, proposal, can, role_class, role)¶
- view_case_edit_text(current_user, db, proposal, can, role_class, role, form)¶
- view_case_edit_figure(current_user, db, proposal, can, role_class, role, fig_id, form, file_)¶
- _view_edit_figure(current_user, db, form, file_, figure, proposal, reviewer, title, target_edit, target_redirect, word_limit=None)¶
- view_case_manage_figure(current_user, db, proposal, can, role_class, role, form)¶
- _view_manage_figure(db, form, proposal, reviewer, role, title, target_edit, target_redirect)¶
- view_case_view_figure(current_user, db, proposal, can, fig_id, role, md5sum, type_=None)¶
- view_case_edit_pdf(current_user, db, proposal, can, role_class, role, file)¶
- view_case_view_pdf(current_user, db, proposal, can, role, md5sum)¶
- view_case_view_pdf_preview(current_user, db, proposal, can, page, role, md5sum)¶
- view_calculation_manage(current_user, db, proposal, can, form)¶
- _view_calculation_manage(db, proposal, reviewer, can, form, title, target_redirect)¶
Internal method to handle the calculation management page for either proposals or reviews.
- view_calculation_view(current_user, db, proposal, can, calculation_id)¶
- view_proposal_pdf_request(current_user, db, proposal, can, form)¶
- view_proposal_pdf_request_status(current_user, db, proposal, can, request_id)¶
- view_proposal_pdf_request_query(current_user, db, proposal, can, request_id)¶
- _get_proposal_pdf_request_dynamic(request)¶
- view_proposal_pdf_download(current_user, db, proposal, can, request_id)¶
- view_proposal_feedback(current_user, db, proposal, can)¶
- _view_proposal_feedback_extra(current_user, db, proposal, can)¶
Method to gather additional information for the proposal feedback page.
- view_proposal_by_code(current_user, db, args)¶
- _edit_text(current_user, db, proposal, role, word_limit, target, form, rows, figures=None, calculations=None, target_redir=None, extra_initialization=None, extra_form_read=None, extra_form_proc=None)¶
- _prepare_calculations(raw_calculations, condense=True)¶
hedwig.facility.generic.view_review¶
- class hedwig.facility.generic.view_review.ProposalWithExtraPermissions(semester_id, semester_name, semester_code, semester_start, semester_end, queue_id, queue_name, queue_code, call_type, call_separate, call_hidden, facility_id, abst_word_lim, tech_word_lim, tech_fig_lim, tech_page_lim, sci_word_lim, sci_fig_lim, sci_page_lim, capt_word_lim, expl_word_lim, date_close, multi_semester, cnrq_word_lim, cnrq_fig_lim, cnrq_page_lim, has_decision, decision_accept, decision_exempt, decision_ready, decision_note, decision_note_format, member, members, reviewer, reviewers, categories, code, can_view_review, can_edit_decision)¶
- _asdict()¶
Return a new dict which maps field names to their values.
- _field_defaults = {}¶
- _fields = ('semester_id', 'semester_name', 'semester_code', 'semester_start', 'semester_end', 'queue_id', 'queue_name', 'queue_code', 'call_type', 'call_separate', 'call_hidden', 'facility_id', 'abst_word_lim', 'tech_word_lim', 'tech_fig_lim', 'tech_page_lim', 'sci_word_lim', 'sci_fig_lim', 'sci_page_lim', 'capt_word_lim', 'expl_word_lim', 'date_close', 'multi_semester', 'cnrq_word_lim', 'cnrq_fig_lim', 'cnrq_page_lim', 'has_decision', 'decision_accept', 'decision_exempt', 'decision_ready', 'decision_note', 'decision_note_format', 'member', 'members', 'reviewer', 'reviewers', 'categories', 'code', 'can_view_review', 'can_edit_decision')¶
- classmethod _make(iterable)¶
Make a new ProposalWithExtraPermissions object from a sequence or iterable
- _replace(**kwds)¶
Return a new ProposalWithExtraPermissions object replacing specified fields with new values
- abst_word_lim¶
Alias for field number 12
Alias for field number 10
- call_separate¶
Alias for field number 9
- call_type¶
Alias for field number 8
- can_edit_decision¶
Alias for field number 39
- can_view_review¶
Alias for field number 38
- capt_word_lim¶
Alias for field number 19
- categories¶
Alias for field number 36
- cnrq_fig_lim¶
Alias for field number 24
- cnrq_page_lim¶
Alias for field number 25
- cnrq_word_lim¶
Alias for field number 23
- code¶
Alias for field number 37
- date_close¶
Alias for field number 21
- decision_accept¶
Alias for field number 27
- decision_exempt¶
Alias for field number 28
- decision_note¶
Alias for field number 30
- decision_note_format¶
Alias for field number 31
- decision_ready¶
Alias for field number 29
- expl_word_lim¶
Alias for field number 20
- facility_id¶
Alias for field number 11
- has_decision¶
Alias for field number 26
- member¶
Alias for field number 32
- members¶
Alias for field number 33
- multi_semester¶
Alias for field number 22
- queue_code¶
Alias for field number 7
- queue_id¶
Alias for field number 5
- queue_name¶
Alias for field number 6
- reviewer¶
Alias for field number 34
- reviewers¶
Alias for field number 35
- sci_fig_lim¶
Alias for field number 17
- sci_page_lim¶
Alias for field number 18
- sci_word_lim¶
Alias for field number 16
- semester_code¶
Alias for field number 2
- semester_end¶
Alias for field number 4
- semester_id¶
Alias for field number 0
- semester_name¶
Alias for field number 1
- semester_start¶
Alias for field number 3
- tech_fig_lim¶
Alias for field number 14
- tech_page_lim¶
Alias for field number 15
- tech_word_lim¶
Alias for field number 13
- class hedwig.facility.generic.view_review.ProposalWithInviteRoles(semester_id, semester_name, semester_code, semester_start, semester_end, queue_id, queue_name, queue_code, call_type, call_separate, call_hidden, facility_id, abst_word_lim, tech_word_lim, tech_fig_lim, tech_page_lim, sci_word_lim, sci_fig_lim, sci_page_lim, capt_word_lim, expl_word_lim, date_close, multi_semester, cnrq_word_lim, cnrq_fig_lim, cnrq_page_lim, has_decision, decision_accept, decision_exempt, decision_ready, decision_note, decision_note_format, member, members, reviewer, reviewers, categories, code, can_view_review, can_edit_decision, invite_roles, add_roles)¶
- _asdict()¶
Return a new dict which maps field names to their values.
- _field_defaults = {}¶
- _fields = ('semester_id', 'semester_name', 'semester_code', 'semester_start', 'semester_end', 'queue_id', 'queue_name', 'queue_code', 'call_type', 'call_separate', 'call_hidden', 'facility_id', 'abst_word_lim', 'tech_word_lim', 'tech_fig_lim', 'tech_page_lim', 'sci_word_lim', 'sci_fig_lim', 'sci_page_lim', 'capt_word_lim', 'expl_word_lim', 'date_close', 'multi_semester', 'cnrq_word_lim', 'cnrq_fig_lim', 'cnrq_page_lim', 'has_decision', 'decision_accept', 'decision_exempt', 'decision_ready', 'decision_note', 'decision_note_format', 'member', 'members', 'reviewer', 'reviewers', 'categories', 'code', 'can_view_review', 'can_edit_decision', 'invite_roles', 'add_roles')¶
- classmethod _make(iterable)¶
Make a new ProposalWithInviteRoles object from a sequence or iterable
- _replace(**kwds)¶
Return a new ProposalWithInviteRoles object replacing specified fields with new values
- abst_word_lim¶
Alias for field number 12
- add_roles¶
Alias for field number 41
Alias for field number 10
- call_separate¶
Alias for field number 9
- call_type¶
Alias for field number 8
- can_edit_decision¶
Alias for field number 39
- can_view_review¶
Alias for field number 38
- capt_word_lim¶
Alias for field number 19
- categories¶
Alias for field number 36
- cnrq_fig_lim¶
Alias for field number 24
- cnrq_page_lim¶
Alias for field number 25
- cnrq_word_lim¶
Alias for field number 23
- code¶
Alias for field number 37
- date_close¶
Alias for field number 21
- decision_accept¶
Alias for field number 27
- decision_exempt¶
Alias for field number 28
- decision_note¶
Alias for field number 30
- decision_note_format¶
Alias for field number 31
- decision_ready¶
Alias for field number 29
- expl_word_lim¶
Alias for field number 20
- facility_id¶
Alias for field number 11
- has_decision¶
Alias for field number 26
- invite_roles¶
Alias for field number 40
- member¶
Alias for field number 32
- members¶
Alias for field number 33
- multi_semester¶
Alias for field number 22
- queue_code¶
Alias for field number 7
- queue_id¶
Alias for field number 5
- queue_name¶
Alias for field number 6
- reviewer¶
Alias for field number 34
- reviewers¶
Alias for field number 35
- sci_fig_lim¶
Alias for field number 17
- sci_page_lim¶
Alias for field number 18
- sci_word_lim¶
Alias for field number 16
- semester_code¶
Alias for field number 2
- semester_end¶
Alias for field number 4
- semester_id¶
Alias for field number 0
- semester_name¶
Alias for field number 1
- semester_start¶
Alias for field number 3
- tech_fig_lim¶
Alias for field number 14
- tech_page_lim¶
Alias for field number 15
- tech_word_lim¶
Alias for field number 13
- class hedwig.facility.generic.view_review.ProposalWithReviewerPersons(semester_id, semester_name, semester_code, semester_start, semester_end, queue_id, queue_name, queue_code, call_type, call_separate, call_hidden, facility_id, abst_word_lim, tech_word_lim, tech_fig_lim, tech_page_lim, sci_word_lim, sci_fig_lim, sci_page_lim, capt_word_lim, expl_word_lim, date_close, multi_semester, cnrq_word_lim, cnrq_fig_lim, cnrq_page_lim, has_decision, decision_accept, decision_exempt, decision_ready, decision_note, decision_note_format, member, members, reviewer, reviewers, categories, code, reviewer_person_ids)¶
- _asdict()¶
Return a new dict which maps field names to their values.
- _field_defaults = {}¶
- _fields = ('semester_id', 'semester_name', 'semester_code', 'semester_start', 'semester_end', 'queue_id', 'queue_name', 'queue_code', 'call_type', 'call_separate', 'call_hidden', 'facility_id', 'abst_word_lim', 'tech_word_lim', 'tech_fig_lim', 'tech_page_lim', 'sci_word_lim', 'sci_fig_lim', 'sci_page_lim', 'capt_word_lim', 'expl_word_lim', 'date_close', 'multi_semester', 'cnrq_word_lim', 'cnrq_fig_lim', 'cnrq_page_lim', 'has_decision', 'decision_accept', 'decision_exempt', 'decision_ready', 'decision_note', 'decision_note_format', 'member', 'members', 'reviewer', 'reviewers', 'categories', 'code', 'reviewer_person_ids')¶
- classmethod _make(iterable)¶
Make a new ProposalWithReviewerPersons object from a sequence or iterable
- _replace(**kwds)¶
Return a new ProposalWithReviewerPersons object replacing specified fields with new values
- abst_word_lim¶
Alias for field number 12
Alias for field number 10
- call_separate¶
Alias for field number 9
- call_type¶
Alias for field number 8
- capt_word_lim¶
Alias for field number 19
- categories¶
Alias for field number 36
- cnrq_fig_lim¶
Alias for field number 24
- cnrq_page_lim¶
Alias for field number 25
- cnrq_word_lim¶
Alias for field number 23
- code¶
Alias for field number 37
- date_close¶
Alias for field number 21
- decision_accept¶
Alias for field number 27
- decision_exempt¶
Alias for field number 28
- decision_note¶
Alias for field number 30
- decision_note_format¶
Alias for field number 31
- decision_ready¶
Alias for field number 29
- expl_word_lim¶
Alias for field number 20
- facility_id¶
Alias for field number 11
- has_decision¶
Alias for field number 26
- member¶
Alias for field number 32
- members¶
Alias for field number 33
- multi_semester¶
Alias for field number 22
- queue_code¶
Alias for field number 7
- queue_id¶
Alias for field number 5
- queue_name¶
Alias for field number 6
- reviewer¶
Alias for field number 34
- reviewer_person_ids¶
Alias for field number 38
- reviewers¶
Alias for field number 35
- sci_fig_lim¶
Alias for field number 17
- sci_page_lim¶
Alias for field number 18
- sci_word_lim¶
Alias for field number 16
- semester_code¶
Alias for field number 2
- semester_end¶
Alias for field number 4
- semester_id¶
Alias for field number 0
- semester_name¶
Alias for field number 1
- semester_start¶
Alias for field number 3
- tech_fig_lim¶
Alias for field number 14
- tech_page_lim¶
Alias for field number 15
- tech_word_lim¶
Alias for field number 13
- class hedwig.facility.generic.view_review.ProposalWithTargets(semester_id, semester_name, semester_code, semester_start, semester_end, queue_id, queue_name, queue_code, call_type, call_separate, call_hidden, facility_id, abst_word_lim, tech_word_lim, tech_fig_lim, tech_page_lim, sci_word_lim, sci_fig_lim, sci_page_lim, capt_word_lim, expl_word_lim, date_close, multi_semester, cnrq_word_lim, cnrq_fig_lim, cnrq_page_lim, has_decision, decision_accept, decision_exempt, decision_ready, decision_note, decision_note_format, member, members, reviewer, reviewers, categories, code, targets)¶
- _asdict()¶
Return a new dict which maps field names to their values.
- _field_defaults = {}¶
- _fields = ('semester_id', 'semester_name', 'semester_code', 'semester_start', 'semester_end', 'queue_id', 'queue_name', 'queue_code', 'call_type', 'call_separate', 'call_hidden', 'facility_id', 'abst_word_lim', 'tech_word_lim', 'tech_fig_lim', 'tech_page_lim', 'sci_word_lim', 'sci_fig_lim', 'sci_page_lim', 'capt_word_lim', 'expl_word_lim', 'date_close', 'multi_semester', 'cnrq_word_lim', 'cnrq_fig_lim', 'cnrq_page_lim', 'has_decision', 'decision_accept', 'decision_exempt', 'decision_ready', 'decision_note', 'decision_note_format', 'member', 'members', 'reviewer', 'reviewers', 'categories', 'code', 'targets')¶
- classmethod _make(iterable)¶
Make a new ProposalWithTargets object from a sequence or iterable
- _replace(**kwds)¶
Return a new ProposalWithTargets object replacing specified fields with new values
- abst_word_lim¶
Alias for field number 12
Alias for field number 10
- call_separate¶
Alias for field number 9
- call_type¶
Alias for field number 8
- capt_word_lim¶
Alias for field number 19
- categories¶
Alias for field number 36
- cnrq_fig_lim¶
Alias for field number 24
- cnrq_page_lim¶
Alias for field number 25
- cnrq_word_lim¶
Alias for field number 23
- code¶
Alias for field number 37
- date_close¶
Alias for field number 21
- decision_accept¶
Alias for field number 27
- decision_exempt¶
Alias for field number 28
- decision_note¶
Alias for field number 30
- decision_note_format¶
Alias for field number 31
- decision_ready¶
Alias for field number 29
- expl_word_lim¶
Alias for field number 20
- facility_id¶
Alias for field number 11
- has_decision¶
Alias for field number 26
- member¶
Alias for field number 32
- members¶
Alias for field number 33
- multi_semester¶
Alias for field number 22
- queue_code¶
Alias for field number 7
- queue_id¶
Alias for field number 5
- queue_name¶
Alias for field number 6
- reviewer¶
Alias for field number 34
- reviewers¶
Alias for field number 35
- sci_fig_lim¶
Alias for field number 17
- sci_page_lim¶
Alias for field number 18
- sci_word_lim¶
Alias for field number 16
- semester_code¶
Alias for field number 2
- semester_end¶
Alias for field number 4
- semester_id¶
Alias for field number 0
- semester_name¶
Alias for field number 1
- semester_start¶
Alias for field number 3
- targets¶
Alias for field number 38
- tech_fig_lim¶
Alias for field number 14
- tech_page_lim¶
Alias for field number 15
- tech_word_lim¶
Alias for field number 13
- class hedwig.facility.generic.view_review.ProposalWithViewReviewLinks(semester_id, semester_name, semester_code, semester_start, semester_end, queue_id, queue_name, queue_code, call_type, call_separate, call_hidden, facility_id, abst_word_lim, tech_word_lim, tech_fig_lim, tech_page_lim, sci_word_lim, sci_fig_lim, sci_page_lim, capt_word_lim, expl_word_lim, date_close, multi_semester, cnrq_word_lim, cnrq_fig_lim, cnrq_page_lim, has_decision, decision_accept, decision_exempt, decision_ready, decision_note, decision_note_format, member, members, reviewer, reviewers, categories, code, target_proposal, target_review)¶
- _asdict()¶
Return a new dict which maps field names to their values.
- _field_defaults = {}¶
- _fields = ('semester_id', 'semester_name', 'semester_code', 'semester_start', 'semester_end', 'queue_id', 'queue_name', 'queue_code', 'call_type', 'call_separate', 'call_hidden', 'facility_id', 'abst_word_lim', 'tech_word_lim', 'tech_fig_lim', 'tech_page_lim', 'sci_word_lim', 'sci_fig_lim', 'sci_page_lim', 'capt_word_lim', 'expl_word_lim', 'date_close', 'multi_semester', 'cnrq_word_lim', 'cnrq_fig_lim', 'cnrq_page_lim', 'has_decision', 'decision_accept', 'decision_exempt', 'decision_ready', 'decision_note', 'decision_note_format', 'member', 'members', 'reviewer', 'reviewers', 'categories', 'code', 'target_proposal', 'target_review')¶
- classmethod _make(iterable)¶
Make a new ProposalWithViewReviewLinks object from a sequence or iterable
- _replace(**kwds)¶
Return a new ProposalWithViewReviewLinks object replacing specified fields with new values
- abst_word_lim¶
Alias for field number 12
Alias for field number 10
- call_separate¶
Alias for field number 9
- call_type¶
Alias for field number 8
- capt_word_lim¶
Alias for field number 19
- categories¶
Alias for field number 36
- cnrq_fig_lim¶
Alias for field number 24
- cnrq_page_lim¶
Alias for field number 25
- cnrq_word_lim¶
Alias for field number 23
- code¶
Alias for field number 37
- date_close¶
Alias for field number 21
- decision_accept¶
Alias for field number 27
- decision_exempt¶
Alias for field number 28
- decision_note¶
Alias for field number 30
- decision_note_format¶
Alias for field number 31
- decision_ready¶
Alias for field number 29
- expl_word_lim¶
Alias for field number 20
- facility_id¶
Alias for field number 11
- has_decision¶
Alias for field number 26
- member¶
Alias for field number 32
- members¶
Alias for field number 33
- multi_semester¶
Alias for field number 22
- queue_code¶
Alias for field number 7
- queue_id¶
Alias for field number 5
- queue_name¶
Alias for field number 6
- reviewer¶
Alias for field number 34
- reviewers¶
Alias for field number 35
- sci_fig_lim¶
Alias for field number 17
- sci_page_lim¶
Alias for field number 18
- sci_word_lim¶
Alias for field number 16
- semester_code¶
Alias for field number 2
- semester_end¶
Alias for field number 4
- semester_id¶
Alias for field number 0
- semester_name¶
Alias for field number 1
- semester_start¶
Alias for field number 3
- target_proposal¶
Alias for field number 38
- target_review¶
Alias for field number 39
- tech_fig_lim¶
Alias for field number 14
- tech_page_lim¶
Alias for field number 15
- tech_word_lim¶
Alias for field number 13
- class hedwig.facility.generic.view_review.ReviewerWithCalcFig(person_name, person_public, person_registered, user_id, institution_id, institution_name, institution_department, institution_organization, institution_country, institution_name_abbr, institution_department_abbr, institution_organization_abbr, invitation_token, invitation_expiry, review_extra, acceptance_accepted, acceptance_text, acceptance_format, acceptance_date, note, note_format, calculations, figures, can_view, can_edit, can_view_rating)¶
- _asdict()¶
Return a new dict which maps field names to their values.
- _field_defaults = {}¶
- _fields = ('person_name', 'person_public', 'person_registered', 'user_id', 'institution_id', 'institution_name', 'institution_department', 'institution_organization', 'institution_country', 'institution_name_abbr', 'institution_department_abbr', 'institution_organization_abbr', 'invitation_token', 'invitation_expiry', 'review_extra', 'acceptance_accepted', 'acceptance_text', 'acceptance_format', 'acceptance_date', 'note', 'note_format', 'calculations', 'figures', 'can_view', 'can_edit', 'can_view_rating')¶
- classmethod _make(iterable)¶
Make a new ReviewerWithCalcFig object from a sequence or iterable
- _replace(**kwds)¶
Return a new ReviewerWithCalcFig object replacing specified fields with new values
- acceptance_accepted¶
Alias for field number 15
- acceptance_date¶
Alias for field number 18
- acceptance_format¶
Alias for field number 17
- acceptance_text¶
Alias for field number 16
- calculations¶
Alias for field number 21
- can_edit¶
Alias for field number 24
- can_view¶
Alias for field number 23
- can_view_rating¶
Alias for field number 25
- figures¶
Alias for field number 22
- institution_country¶
Alias for field number 8
- institution_department¶
Alias for field number 6
- institution_department_abbr¶
Alias for field number 10
- institution_id¶
Alias for field number 4
- institution_name¶
Alias for field number 5
- institution_name_abbr¶
Alias for field number 9
- institution_organization¶
Alias for field number 7
- institution_organization_abbr¶
Alias for field number 11
- invitation_expiry¶
Alias for field number 13
- invitation_token¶
Alias for field number 12
- note¶
Alias for field number 19
- note_format¶
Alias for field number 20
- person_name¶
Alias for field number 0
- person_public¶
Alias for field number 1
- person_registered¶
Alias for field number 2
- review_extra¶
Alias for field number 14
- user_id¶
Alias for field number 3
- class hedwig.facility.generic.view_review.RoleClosingInfo(role_name, deadline, future)¶
- _asdict()¶
Return a new dict which maps field names to their values.
- _field_defaults = {}¶
- _fields = ('role_name', 'deadline', 'future')¶
- classmethod _make(iterable)¶
Make a new RoleClosingInfo object from a sequence or iterable
- _replace(**kwds)¶
Return a new RoleClosingInfo object replacing specified fields with new values
- deadline¶
Alias for field number 1
- future¶
Alias for field number 2
- role_name¶
Alias for field number 0
- class hedwig.facility.generic.view_review.GenericReview¶
- view_review_call(current_user, db, call, can)¶
- view_review_call_tabulation(current_user, db, call, can)¶
- view_review_call_tabulation_download(current_user, db, call, can, with_cois=True)¶
- _get_proposal_tabulation(current_user, db, call, can, with_extra=False)¶
Prepare information for the detailed tabulation of proposals.
This is used to prepare the information both for the online version and the downloadable CSV file. For the CSV file, the with_extra option is enabled and additional information, beyond that which can be displayed on the online version, is retrieved.
- _get_proposal_tabulation_titles(tabulation)¶
- _get_proposal_tabulation_rows(tabulation)¶
- view_review_call_allocation(current_user, db, call, can)¶
- _get_review_call_allocation(db, call, can)¶
- _get_ra_inaccessible(date_start, date_end)¶
Estimate which RAs are inaccessible in the middle of the shift during a semester between the given dates by considering a target with declination equal to the observatory’s latitude.
- _attach_proposal_targets(db, proposals)¶
Attach targets (and construct codes) for the given proposals.
- view_review_call_allocation_query(current_user, db, call, can)¶
- _get_review_call_allocation_dynamic(db, call, can, proposals)¶
Get dynamic information, including total time (hours) for each proposal.
This method should be overridden by subclasses to return the most suitable representative total time for each proposal. For example this could be the total allocation, falling back to the total request if no allocation has yet been assigned.
- view_review_call_stats(current_user, db, call, can)¶
- view_review_call_stats_download(current_user, db, call, can)¶
- _get_review_statistics(current_user, db, call, can)¶
- view_review_call_clash(current_user, db, call, can, args, form)¶
- view_review_call_clash_pair(current_user, db, call, can, proposal_a_id, proposal_b_id, args)¶
- view_review_affiliation_weight(current_user, db, call, can, form)¶
- view_review_call_available(current_user, db, call, can, form)¶
- _view_review_call_available_get(db, call, form)¶
- _view_review_call_available_save(db, call, info)¶
- _view_review_call_available_extra(db, call, info)¶
- view_review_call_deadline(current_user, db, call, can, form)¶
- view_review_call_reviewers(current_user, db, call, can, args)¶
- view_reviewer_grid(current_user, db, call, can, primary_role, form)¶
- view_reviewer_note(current_user, db, reviewer, proposal, form)¶
- view_reviewer_notify(current_user, db, call, can, role, form)¶
- _message_review_notification(current_user, db, role, person_id, proposals, deadline)¶
Send a message to a an assigned reviewer informing them of their review assignments and update the notified flag for the corresponding entries in the reviewers table.
This method takes a list of proposals, each of which should have a reviewer attribute corresponding to the review for which the notification is being sent.
- view_reviewer_thank(current_user, db, call, can, role, form)¶
- _message_review_thank(current_user, db, role, person_id, proposals)¶
Send a message to an invited reviewer thanking them for their contribution.
This method takes a list of proposals, each of which should have a reviewer attribute corresponding to the review for which the message is being sent.
- view_reviewer_add(current_user, db, proposal, role, form)¶
- _message_review_invite(current_user, db, proposal, role, person_id, person_name, person_registered, reviewer_id, is_reminder=False, reminder_token=None, reminder_expiry=None)¶
Send a review invitation or reminder email message.
- view_reviewer_remove(current_user, db, reviewer, proposal, form)¶
- view_reviewer_reinvite(current_user, db, reviewer, proposal, form)¶
- view_reviewer_remind(current_user, db, reviewer, proposal, form)¶
- view_reviewer_notify_again(current_user, db, reviewer, proposal, form)¶
- _view_reviewer_reinvite_remind(current_user, db, reviewer, proposal, form, is_reminder=False, is_repeat_notification=False)¶
- view_review_new(current_user, db, proposal, reviewer_role, args, form)¶
- view_review_accept(current_user, db, reviewer, proposal, can, args, form)¶
- view_review_clear_accept(current_user, db, reviewer, proposal, form)¶
- view_review_info(current_user, db, reviewer, proposal, can)¶
- view_review_edit(current_user, db, reviewer, proposal, can, args, form)¶
- _view_review_new_or_edit(current_user, db, reviewer, proposal, args, form, reviewer_role=None, auth_cache=None)¶
- _view_review_edit_get(db, reviewer, proposal, form)¶
Placeholder for facility-specific method to read form values containing extra information for the review.
Parsing errors should be left for later.
- Returns:
an object containing any additional information which the facility class requires.
- Raises:
HTTPError – if a serious parsing error occurs. (Current input can not be shown again in the form at this point.)
- _view_review_edit_save(db, reviewer, proposal, info)¶
Placeholder for facility-specific method to parse previously-read form inputs and store them in the database.
- Raises:
UserError – in the event of a problem with the input. (Current input will be shown again in the form for correction.)
- _view_review_edit_extra(db, reviewer, proposal, info)¶
Placeholder for facility-specific method to generate extra information to show in the proposal edit page.
info will be the object returned by _view_review_edit_get if a POST is being handled, or None otherwise.
- view_review_calculation_manage(current_user, db, reviewer, proposal, can, form)¶
- view_review_calculation_view(current_user, db, reviewer, proposal, can, review_calculation_id)¶
- view_review_edit_figure(current_user, db, reviewer, proposal, can, fig_id, form, file_)¶
- view_review_view_figure(current_user, db, reviewer, proposal, can, fig_id, md5sum, type_=None)¶
- view_review_manage_figure(current_user, db, reviewer, proposal, can, form)¶
- view_proposal_reviews(current_user, db, proposal)¶
- view_proposal_decision(current_user, db, proposal, args, form)¶
- _view_proposal_decision_get(db, proposal, form)¶
Placeholder for a method where a facility-specific subclass could read a set of form values representing its additional information from the decision page. The method should return an object containing anything the class needs to know from the form. Parsing errors should be left for later.
- _view_proposal_decision_save(db, proposal, info)¶
Placeholder for a method where a facility-specific subclass could parse the (previously read) form inputs and store them in the database.
Can raise UserError in the case of a problem with the inputs.
The “proposal” object will have been updated to include the decision_accept and decision_exempt values as currently being entered.
- _view_proposal_decision_extra(db, proposal, info)¶
Placeholder for a method where a facility-specific subclass could generate extra information to show in the decision page. The “info” will be None if a POST is not being handled, otherwise it will be the object returned by _view_proposal_decision_get.
- view_review_advance_final(current_user, db, call, can, form)¶
- view_review_confirm_feedback(current_user, db, call, can, form)¶