Ejemplo n.º 1
0
    def notes(self):
        """Return the notes section of the report.

        :return: The notes that should be attached to this impact report.
        :rtype: list
        """
        if get_needs_provenance_value(self.parameters) is None:
            needs_provenance = ''
        else:
            needs_provenance = tr(get_needs_provenance_value(self.parameters))

        if self.volcano_names:
            sorted_volcano_names = ', '.join(sorted(self.volcano_names))
        else:
            sorted_volcano_names = tr('Not specified in data')

        fields = [
            tr('Map shows buildings affected in each of the volcano buffered '
               'zones.'),
            tr('Total population in the analysis area: %s') %
            format_int(population_rounding(self.total_population)),
            tr('<sup>1</sup>People need evacuation if they are within the '
               'volcanic hazard zones.'),
            tr('Volcanoes considered: %s.') % sorted_volcano_names,
        ]
        if needs_provenance:
            fields.append(needs_provenance)

        if self.no_data_warning:
            fields = fields + no_data_warning
        # include any generic exposure specific notes from definitions.py
        fields = fields + self.exposure_notes()
        # include any generic hazard specific notes from definitions.py
        fields = fields + self.hazard_notes()
        return fields
Ejemplo n.º 2
0
    def notes(self):
        """Return the notes section of the report.

        :return: The notes that should be attached to this impact report.
        :rtype: list
        """
        if get_needs_provenance_value(self.parameters) is None:
            needs_provenance = ''
        else:
            needs_provenance = tr(get_needs_provenance_value(self.parameters))
        fields = [
            tr('Map shows buildings affected in each of the volcano buffered '
               'zones.'),
            tr('Total population in the analysis area: %s') %
            population_rounding(self.total_population),
            tr('<sup>1</sup>People need evacuation if they are within the '
               'volcanic hazard zones.'),
            tr('Volcanoes considered: %s.') % self.volcano_names,
            needs_provenance
        ]

        if self.no_data_warning:
            fields = fields + no_data_warning
        # include any generic exposure specific notes from definitions.py
        fields = fields + self.exposure_notes()
        # include any generic hazard specific notes from definitions.py
        fields = fields + self.hazard_notes()
        return fields
Ejemplo n.º 3
0
    def notes(self):
        """Return the notes section of the report.

        :return: The notes that should be attached to this impact report.
        :rtype: list
        """
        population = format_int(population_rounding(self.total_population))
        threshold = format_int(self.parameters['evacuation_percentage'].value)

        if get_needs_provenance_value(self.parameters) is None:
            needs_provenance = ''
        else:
            needs_provenance = tr(get_needs_provenance_value(self.parameters))

        fields = [
            tr('Total population in the analysis area: %s') % population,
            tr('<sup>1</sup>The evacuation threshold used to determine '
               'population needing evacuation is %s%%.') % threshold,
            needs_provenance,
        ]

        if self.no_data_warning:
            fields = fields + no_data_warning
        # include any generic exposure specific notes from definitions.py
        fields = fields + self.exposure_notes()
        # include any generic hazard specific notes from definitions.py
        fields = fields + self.hazard_notes()
        return fields
Ejemplo n.º 4
0
    def notes(self):
        """Return the notes section of the report.

        :return: The notes that should be attached to this impact report.
        :rtype: list
        """
        population = format_int(population_rounding(self.total_population))
        threshold = format_int(self.parameters['evacuation_percentage'].value)

        if get_needs_provenance_value(self.parameters) is None:
            needs_provenance = ''
        else:
            needs_provenance = tr(get_needs_provenance_value(self.parameters))

        fields = [
            tr('Total population in the analysis area: %s') % population,
            tr('<sup>1</sup>The evacuation threshold used to determine '
               'population needing evacuation is %s%%.') % threshold,
            needs_provenance,
        ]

        if self.no_data_warning:
            fields = fields + no_data_warning
        # include any generic exposure specific notes from definitions.py
        fields = fields + self.exposure_notes()
        # include any generic hazard specific notes from definitions.py
        fields = fields + self.hazard_notes()
        return fields
Ejemplo n.º 5
0
    def notes(self):
        """Return the notes section of the report.

        :return: The notes that should be attached to this impact report.
        :rtype: list
        """
        population = format_int(population_rounding(self.total_population))
        thresholds = self.parameters['thresholds'].value

        if get_needs_provenance_value(self.parameters) is None:
            needs_provenance = ''
        else:
            needs_provenance = tr(get_needs_provenance_value(self.parameters))

        fields = [
            tr('Total population in the analysis area: %s') % population,
            tr('<sup>1</sup>People need evacuation if flood levels exceed '
               '%(eps).1f m.') % {'eps': thresholds[-1]},
            needs_provenance,
        ]

        if self.no_data_warning:
            fields = fields + no_data_warning
        # include any generic exposure specific notes from definitions.py
        fields = fields + self.exposure_notes()
        # include any generic hazard specific notes from definitions.py
        fields = fields + self.hazard_notes()
        return fields
Ejemplo n.º 6
0
    def notes(self):
        """Return the notes section of the report.

        :return: The notes that should be attached to this impact report.
        :rtype: list
        """
        population = format_int(population_rounding(self.total_population))
        thresholds = self.parameters['thresholds'].value

        if get_needs_provenance_value(self.parameters) is None:
            needs_provenance = ''
        else:
            needs_provenance = tr(get_needs_provenance_value(self.parameters))

        fields = [
            tr('Total population in the analysis area: %s') % population,
            tr('<sup>1</sup>People need evacuation if flood levels exceed '
               '%(eps).1f m.') % {
                   'eps': thresholds[-1]
               },
            needs_provenance,
        ]

        if self.no_data_warning:
            fields = fields + no_data_warning
        # include any generic exposure specific notes from definitions.py
        fields = fields + self.exposure_notes()
        # include any generic hazard specific notes from definitions.py
        fields = fields + self.hazard_notes()
        return fields
Ejemplo n.º 7
0
    def notes(self):
        """Return the notes section of the report.

        :return: The notes that should be attached to this impact report.
        :rtype: list
        """
        if get_needs_provenance_value(self.parameters) is None:
            needs_provenance = ''
        else:
            needs_provenance = tr(get_needs_provenance_value(self.parameters))

        if self.volcano_names:
            sorted_volcano_names = ', '.join(sorted(self.volcano_names))
        else:
            sorted_volcano_names = tr('Not specified in data')

        fields = [
            tr('Total population in the analysis area: %s') %
            format_int(population_rounding(self.total_population)),
            tr('<sup>1</sup>People need evacuation if they are within the '
               'volcanic hazard zones.'),
            tr('Volcanoes considered: %s.') % sorted_volcano_names
        ]

        if needs_provenance:
            fields.append(needs_provenance)

        if self.no_data_warning:
            fields = fields + no_data_warning

        # include any generic exposure specific notes from definitions.py
        fields = fields + self.exposure_notes()
        # include any generic hazard specific notes from definitions.py
        fields = fields + self.hazard_notes()
        return fields
Ejemplo n.º 8
0
    def notes(self):
        """Return the notes section of the report.

        :return: The notes that should be attached to this impact report.
        :rtype: safe.messaging.Message
        """
        if get_needs_provenance_value(self.parameters) is None:
            needs_provenance = ''
        else:
            needs_provenance = tr(get_needs_provenance_value(self.parameters))

        message = m.Message(style_class='container')
        message.add(
            m.Heading(tr('Notes and assumptions'), **styles.INFO_STYLE))
        checklist = m.BulletedList()
        checklist.add(tr(
            'Map shows buildings affected in each of the volcano buffered '
            'zones.'))
        checklist.add(tr(
            'Total population in the analysis area: %s'
            ) % population_rounding(self.total_population))
        checklist.add(tr(
            '<sup>1</sup>People need evacuation if they are within '
            'the volcanic hazard zones.'))
        names = tr('Volcanoes considered: %s.') % self.volcano_names
        checklist.add(names)
        checklist.add(needs_provenance)
        if self.no_data_warning:
            checklist.add(tr(
                'The layers contained "no data" values. This missing data '
                'was carried through to the impact layer.'))
            checklist.add(tr(
                '"No data" values in the impact layer were treated as 0 '
                'when counting the affected or total population.'))
        checklist.add(tr(
            'All values are rounded up to the nearest integer in '
            'order to avoid representing human lives as fractions.'))
        checklist.add(tr(
            'Population rounding is applied to all population '
            'values, which may cause discrepancies when adding value.'))
        message.add(checklist)
        return message
Ejemplo n.º 9
0
    def notes(self):
        """Return the notes section of the report.

        :return: The notes that should be attached to this impact report.
        :rtype: dict
        """
        title = tr('Notes and assumptions')

        if get_needs_provenance_value(self.parameters) is None:
            needs_provenance = ''
        else:
            needs_provenance = tr(get_needs_provenance_value(self.parameters))
        fields = [
            tr('Map shows buildings affected in each of the volcano buffered '
               'zones.'),
            tr('Total population in the analysis area: %s') %
            population_rounding(self.total_population),
            tr('<sup>1</sup>People need evacuation if they are within the '
               'volcanic hazard zones.'),
            tr('Volcanoes considered: %s.') % self.volcano_names,
            needs_provenance
        ]

        if self.no_data_warning:
            fields.append(tr(
                'The layers contained "no data" values. This missing data '
                'was carried through to the impact layer.'))
            fields.append(tr(
                '"No data" values in the impact layer were treated as 0 '
                'when counting the affected or total population.'))

        fields.extend([
            tr('All values are rounded up to the nearest integer in order to '
               'avoid representing human lives as fractions.'),
            tr('Population rounding is applied to all population values, '
               'which may cause discrepancies when adding value.')
        ])

        return {
            'title': title,
            'fields': fields
        }
Ejemplo n.º 10
0
    def notes(self):
        """Return the notes section of the report.

        :return: The notes that should be attached to this impact report.
        :rtype: safe.messaging.Message
        """
        if get_needs_provenance_value(self.parameters) is None:
            needs_provenance = ''
        else:
            needs_provenance = tr(get_needs_provenance_value(self.parameters))

        message = m.Message(style_class='container')
        message.add(m.Heading(tr('Notes and assumptions'),
                              **styles.INFO_STYLE))
        checklist = m.BulletedList()
        checklist.add(
            tr('Map shows buildings affected in each of the volcano buffered '
               'zones.'))
        checklist.add(
            tr('Total population in the analysis area: %s') %
            population_rounding(self.total_population))
        checklist.add(
            tr('<sup>1</sup>People need evacuation if they are within '
               'the volcanic hazard zones.'))
        names = tr('Volcanoes considered: %s.') % self.volcano_names
        checklist.add(names)
        checklist.add(needs_provenance)
        if self.no_data_warning:
            checklist.add(
                tr('The layers contained "no data" values. This missing data '
                   'was carried through to the impact layer.'))
            checklist.add(
                tr('"No data" values in the impact layer were treated as 0 '
                   'when counting the affected or total population.'))
        checklist.add(
            tr('All values are rounded up to the nearest integer in '
               'order to avoid representing human lives as fractions.'))
        checklist.add(
            tr('Population rounding is applied to all population '
               'values, which may cause discrepancies when adding value.'))
        message.add(checklist)
        return message
Ejemplo n.º 11
0
    def notes(self):
        """Return the notes section of the report.

        :return: The notes that should be attached to this impact report.
        :rtype: list
        """
        notes = [
            {'content': tr('Notes'), 'header': True},
            {
                'content': tr('Total population: %s') % format_int(
                    population_rounding(self.total_population))
            },
            {
                'content': tr(
                    '<sup>1</sup>The evacuation threshold used to determine '
                    'population needing evacuation is %s%%.'),
                'arguments': format_int(
                    self.parameters['evacuation_percentage'].value)
            },
            {
                'content': tr(
                    ''
                    'are within any polygons.'),
                'condition': not self.use_affected_field
            },
            {
                'content': tr(
                    'The layers contained `no data`. This missing data was '
                    'carried through to the impact layer.'),
                'condition': self.no_data_warning
            },
            {
                'content': tr(
                    '`No data` values in the impact layer were treated as 0 '
                    'when counting the affected or total population.'),
                'condition': self.no_data_warning
            },
            {
                'content': get_needs_provenance_value(self.parameters)
            },
            {
                'content': tr(
                    'All values are rounded up to the nearest integer in '
                    'order to avoid representing human lives as fractions.'),
            },
            {
                'content': tr(
                    'Population rounding is applied to all population '
                    'values, which may cause discrepancies when adding '
                    'values.'
                )
            }
        ]
        return notes
Ejemplo n.º 12
0
 def notes(self):
     notes = [
         {
             'content': tr('Notes'),
             'header': True
         },
         {
             'content': tr('Total population: %s') % format_int(
                 population_rounding(self.total_population))
         },
         {
             'content': tr(
                 '<sup>1</sup>People are considered to be displaced if '
                 'they experience and survive a shake level'
                 'of more than 5 on the MMI scale.')
         },
         {
             'content': tr(
                 'The fatality calculation assumes that '
                 'no fatalities occur for shake levels below 4 '
                 'and fatality counts of less than 50 are '
                 'disregarded.')
         },
         {
             'content': tr(
                 'Fatality model is from Institut Teknologi Bandung 2012.'),
             'condition': self.__class__ == ITBFatalityFunction
         },
         {
             'content': tr(
                 'Fatality model is from the '
                 'Population Vulnerability Pager Model.'),
             'condition': self.__class__ != ITBFatalityFunction
         },
         {
             'content': tr(
                 'Map shows the estimation of displaced population.')
         },
         {
             'content': tr(get_needs_provenance_value(self.parameters))
         },
         {
             'content': tr(
                 'All values are rounded up to the nearest integer in '
                 'order to avoid representing human lives as fractions.'),
         },
         {
             'content': tr(
                 'Population rounding is applied to all population '
                 'values, which may cause discrepancies when adding '
                 'values.')
         }
     ]
     return notes
Ejemplo n.º 13
0
    def notes(self):
        """Return the notes section of the report.

        :return: The notes that should be attached to this impact report.
        :rtype: safe.messaging.Message
        """
        if get_needs_provenance_value(self.parameters) is None:
            needs_provenance = ''
        else:
            needs_provenance = tr(get_needs_provenance_value(self.parameters))

        message = m.Message(style_class='container')

        message.add(
            m.Heading(tr('Notes and assumptions'), **styles.INFO_STYLE))
        checklist = m.BulletedList()
        population = format_int(population_rounding(self.total_population))
        checklist.add(tr(
            'Total population in the analysis area: %s') % population)
        threshold = format_int(self.parameters['evacuation_percentage'].value)
        checklist.add(tr(
            '<sup>1</sup>The evacuation threshold used to determine '
            'population needing evacuation is %s%%.') % threshold)

        checklist.add(needs_provenance)
        if self.no_data_warning:
            checklist.add(tr(
                'The layers contained "no data" values. This missing data '
                'was carried through to the impact layer.'))
            checklist.add(tr(
                '"No data" values in the impact layer were treated as 0 '
                'when counting the affected or total population.'))
        checklist.add(tr(
            'All values are rounded up to the nearest integer in '
            'order to avoid representing human lives as fractions.'))
        checklist.add(tr(
            'Population rounding is applied to all population '
            'values, which may cause discrepancies when adding values.'))

        message.add(checklist)
        return message
Ejemplo n.º 14
0
    def notes(self):
        """Return the notes section of the report.

        :return: The notes that should be attached to this impact report.
        :rtype: dict
        """

        thresholds = self.parameters['thresholds'].value
        if get_needs_provenance_value(self.parameters) is None:
            needs_provenance = ''
        else:
            needs_provenance = tr(get_needs_provenance_value(self.parameters))

        title = tr('Notes and assumptions')

        fields = [
            tr('Total population in the analysis area: %s') %
            population_rounding(self.total_population),
            tr('<sup>1</sup>People need evacuation if flood levels exceed '
               '%(eps).1f m.') % {'eps': thresholds[-1]},
            needs_provenance
        ]

        if self.no_data_warning:
            fields.append(tr(
                'The layers contained "no data" values. This missing data '
                'was carried through to the impact layer.'))
            fields.append(tr(
                '"No data" values in the impact layer were treated as 0 '
                'when counting the affected or total population.'))
        fields.extend([
            tr('All values are rounded up to the nearest integer in order to '
               'avoid representing human lives as fractions.'),
            tr('Population rounding is applied to all population values, '
               'which may cause discrepancies when adding values.')
        ])

        return {
            'title': title,
            'fields': fields
        }
Ejemplo n.º 15
0
    def notes(self):
        """Return the notes section of the report.

        :return: The notes that should be attached to this impact report.
        :rtype: dict
        """
        title = tr('Notes and assumptions')

        population = format_int(population_rounding(self.total_population))
        threshold = format_int(self.parameters['evacuation_percentage'].value)

        if get_needs_provenance_value(self.parameters) is None:
            needs_provenance = ''
        else:
            needs_provenance = tr(get_needs_provenance_value(self.parameters))

        fields = [
            tr('Total population in the analysis area: %s') % population,
            tr('<sup>1</sup>The evacuation threshold used to determine '
               'population needing evacuation is %s%%.') % threshold,
            needs_provenance,
        ]

        if self.no_data_warning:
            fields.append(tr(
                'The layers contained "no data" values. This missing data '
                'was carried through to the impact layer.'))
            fields.append(tr(
                '"No data" values in the impact layer were treated as 0 '
                'when counting the affected or total population.'))
        fields.extend([
            tr('All values are rounded up to the nearest integer in order to '
               'avoid representing human lives as fractions.'),
            tr('Population rounding is applied to all population values, '
               'which may cause discrepancies when adding values.')
        ])

        return {
            'title': title,
            'fields': fields
        }
Ejemplo n.º 16
0
    def notes(self):
        """Return the notes section of the report.

        :return: The notes that should be attached to this impact report.
        :rtype: list
        """
        notes = [
            {
                'content': tr('Notes'),
                'header': True
            },
            {
                'content': tr('Total population: %s') % format_int(
                    population_rounding(self.total_population))
            },
            {
                'content': tr('Volcanoes considered: %s'),
                'header': True,
                'arguments': self.volcano_names
            },
            {
                'content': tr(
                    '<sup>1</sup>People need evacuation if they are within '
                    'the volcanic hazard zones.'),
            },
            {
                'content': tr(get_needs_provenance_value(self.parameters)),
            },
            {
                'content': tr(
                    'The layers contained `no data`. This missing data was '
                    'carried through to the impact layer.'),
                'condition': self.no_data_warning
            },
            {
                'content': tr(
                    '`No data` values in the impact layer were treated as 0 '
                    'when counting the affected or total population.'),
                'condition': self.no_data_warning
            },
            {
                'content': tr(
                    'All values are rounded up to the nearest integer in '
                    'order to avoid representing human lives as fractions.'),
            },
            {
                'content': tr(
                    'Population rounding is applied to all population '
                    'values, which may cause discrepancies when adding '
                    'values.')
            }
        ]
        return notes
Ejemplo n.º 17
0
    def notes(self):
        """Return the notes section of the report.

        :return: The notes that should be attached to this impact report.
        :rtype: list
        """
        thresholds = self.parameters['thresholds'].value
        notes = [
            {
                'content': tr('Notes'),
                'header': True
            },
            {
                'content': tr('Total population: %s') % population_rounding(
                    self.total_population)
            },
            {
                'content': tr(
                    '<sup>1</sup>People need evacuation if flood levels '
                    'exceed %(eps).1f m.') % {'eps': thresholds[-1]},
            },
            {
                'content': tr(get_needs_provenance_value(self.parameters)),
            },
            {
                'content': tr(
                    'The layers contained `no data`. This missing data was '
                    'carried through to the impact layer.'),
                'condition': self.no_data_warning
            },
            {
                'content': tr(
                    '`No data` values in the impact layer were treated as 0 '
                    'when counting the affected or total population.'),
                'condition': self.no_data_warning
            },
            {
                'content': tr(
                    'All values are rounded up to the nearest integer in '
                    'order to avoid representing human lives as fractions.'),
            },
            {
                'content': tr(
                    'Population rounding is applied to all population '
                    'values, which may cause discrepancies when adding '
                    'values.')
            }
        ]
        return notes
Ejemplo n.º 18
0
    def notes(self):
        """Notes and caveats for the IF report.

        :returns: List of dicts containing notes.
        :rtype: list
        """
        message = m.Message(style_class='container')
        message.add(
            m.Heading(tr('Notes and assumptions'), **styles.INFO_STYLE))

        checklist = m.BulletedList()

        checklist.add(tr(
            'Total population in the analysis area: %s'
            ) % format_int(population_rounding(self.total_population)))

        checklist.add(tr(
            '<sup>1</sup>People are displaced if '
            'they experience and survive a shake level'
            'of more than 5 on the MMI scale.'))

        checklist.add(tr(
            'The fatality calculation assumes that '
            'no fatalities occur for shake levels below 4 '
            'and fatality counts of less than 50 are '
            'disregarded.'))

        if self.__class__ != ITBFatalityFunction:
            checklist.add(tr(
                'Fatality model is from Institut Teknologi Bandung 2012.'))
            checklist.add(tr(
                'Fatality model is from the Population Vulnerability '
                'Pager Model.'))

        checklist.add(tr('Map shows the estimation of displaced population.'))

        checklist.add(tr(get_needs_provenance_value(self.parameters)))
        checklist.add(tr(
            'All values are rounded up to the nearest integer in '
            'order to avoid representing human lives as fractions.'))
        checklist.add(tr(
            'Population rounding is applied to all population '
            'values, which may cause discrepancies when adding values.'))

        message.add(checklist)
        return message
Ejemplo n.º 19
0
    def notes(self):
        """Notes and caveats for the IF report.

        :returns: List of dicts containing notes.
        :rtype: list
        """
        message = m.Message(style_class='container')
        message.add(
            m.Heading(tr('Notes and assumptions'), **styles.INFO_STYLE))

        checklist = m.BulletedList()

        checklist.add(tr(
            'Total population in the analysis area: %s'
            ) % format_int(population_rounding(self.total_population)))

        checklist.add(tr(
            '<sup>1</sup>People are displaced if '
            'they experience and survive a shake level'
            'of more than 5 on the MMI scale.'))

        checklist.add(tr(
            'The fatality calculation assumes that '
            'no fatalities occur for shake levels below 4 '
            'and fatality counts of less than 50 are '
            'disregarded.'))

        if self.__class__ != ITBFatalityFunction:
            checklist.add(tr(
                'Fatality model is from Institut Teknologi Bandung 2012.'))
            checklist.add(tr(
                'Fatality model is from the Population Vulnerability '
                'Pager Model.'))

        checklist.add(tr('Map shows the estimation of displaced population.'))

        checklist.add(tr(get_needs_provenance_value(self.parameters)))
        checklist.add(tr(
            'All values are rounded up to the nearest integer in '
            'order to avoid representing human lives as fractions.'))
        checklist.add(tr(
            'Population rounding is applied to all population '
            'values, which may cause discrepancies when adding values.'))

        message.add(checklist)
        return message