def set_inception(self): """ Set the building year. The 'byggar' column can have many forms, but here we only process the obvious cases: 1865 [[1865]] It can also look like: 1100- eller 1200-talet and many other variants, which are ignored. """ if self.has_non_empty_attribute("byggar"): year_parsed = utils.parse_year(self.byggar) if isinstance(year_parsed, int): date_dict = {"year": year_parsed} self.add_statement("inception", utils.package_time(date_dict))
def set_manufacture_year(self): """ Set the manufacture year. If the column 'byggar' has a parsable value, use it as year of manufacture. Use WLM database as a source. """ if self.has_non_empty_attribute("byggar"): byggar = utils.parse_year( utils.remove_characters(self.byggar, ".,")) if isinstance(byggar, int): ref = self.wlm_source self.add_statement( "inception", utils.package_time({"year": byggar}), refs=[ref]) else: self.add_to_report("byggår", self.byggar)
def set_inception(self): if self.has_non_empty_attribute("opforelsesar"): inception = utils.parse_year(self.opforelsesar) if isinstance(inception, int): self.add_statement("inception", utils.package_time({"year": inception}))