import sys from matplotlib import pyplot as plt sys.path.append("../") from autecology_xml import AutecologyXML #xmltest = AutecologyXML(filename = "../../../_knowledgerules/parameters/water_quality/Light_extinction.xml") xmltest = AutecologyXML( filename="../../../_knowledgerules/parameters/hydrodynamics/Fetch.xml") #xmltest = AutecologyXML(filename = "../../../_knowledgerules/parameters/hydrodynamics/Watersurface.xml") xmltest._readxml() print(type(xmltest.xmlroot)) xmltest._scan() print(xmltest.topic_name) print(xmltest.commonnames) xmltest._scan_modeltype("HSI") print(xmltest.modeltypename) print(xmltest.systems) xmltest._scan_knowledgerules(modeltypename="HSI", systemname="ijsselmeergebied") print(xmltest.XMLconvention["allowed_knowledgeRulesCategories"]) print(xmltest.knowledgeRulesNames) print(all(elem in xmltest.XMLconvention["allowed_knowledgeRulesCategories"] for elem \ in xmltest.knowledgeRulesCategories))
sys.path.append("../") from autecology_xml import AutecologyXML #xmltest = AutecologyXML(filename = "../../../_knowledgerules/species/Birds/Phalacrocorax carbo.xml") #xmltest = AutecologyXML(filename = "../../../_knowledgerules/species/Molluscs/Dreissena_polymorpha.xml") #xmltest = AutecologyXML(filename = "../../../_knowledgerules/species/Macrophytes/Nitellopsis obtusa.xml") xmltest = AutecologyXML( filename= "../../../_knowledgerules/species/Macrophytes/Myriophyllum_spicatum.xml") xmltest._readxml() print(type(xmltest.xmlroot)) xmltest._scan() print(xmltest.topic_name) print(xmltest.EoL_ID) print(xmltest.EoL_Link) print(xmltest.latinname) print(xmltest.commonnames) xmltest._scan_modeltype("HSI") print(xmltest.modeltypename) print(xmltest.systems) xmltest._scan_knowledgerules(modeltypename=xmltest.modeltypename, systemname=xmltest.systems[0]) print(xmltest.XMLconvention["allowed_knowledgeRulesCategories"]) print(xmltest.knowledgeRulesNames) print(all(elem in xmltest.XMLconvention["allowed_knowledgeRulesCategories"] for elem \ in xmltest.knowledgeRulesCategories)) print("Done.")
import sys sys.path.append("../") from autecology_xml import AutecologyXML xmltest = AutecologyXML( filename="../../../_knowledgerules/species/Macrophytes/Chara_spp.xml") xmltest._readxml() print(type(xmltest.xmlroot)) xmltest._scan() testext = xmltest._read_topicdescription() print(type(testext)) xmltest._scan_modeltype("HSI") xmltest._scan_knowledgerules(modeltypename="HSI", systemname="Markermeer") print(all(elem in xmltest.XMLconvention["allowed_knowledgeRulesCategories"] for elem \ in xmltest.knowledgeRulesCategories)) print(xmltest.knowledgeRulesNames) print(xmltest.knowledgeRulesCategories) print(xmltest.XMLconvention["allowed_knowledgeRulesCategories"]) fb_tag = xmltest.get_element_formula_based(modeltypename="HSI", systemname="Markermeer", fbname="P_Chara_visibility") fb_data = xmltest.get_data_formula_based_data(fb_tag) print(fb_data) print(fb_data['parameters']) print(fb_data['parameters'][0]['data']) print(type(fb_data)) fb_settings = {
validation_log.append(["Missing language in CommonNames :", str(miss_species_description) +". File : " + path_xml_file]) else: validation_log.append(["Someting wrong between languages SpeciesDescription and CommonNames, please investigate : " + path_xml_file]) for cur_modeltype in xmltest.modeltypes: #check scan of XML modeltypes try: xmltest._scan_modeltype(cur_modeltype) except: validation_log.append(["XML ModelType could not be scanned with AutecologyXML. File : " + path_xml_file +\ " with ModelType " + str(cur_modeltype)]) continue for cur_system in xmltest.systems: try: xmltest._scan_knowledgerules(cur_modeltype, cur_system) except: validation_log.append(["XML Knowledgerules could not be scanned with AutecologyXML. File : " + path_xml_file +\ " with ModelType " + str(cur_modeltype) + " and System " + str(cur_system)]) continue #check if languages are correct cur_system_description = xmltest._read_systemdescription(cur_modeltype, cur_system) cur_system_description_LANG = sorted([line["language"] for line in cur_system_description]) if(cur_species_commonname_LANG != cur_system_description_LANG): miss_common_name = (set(cur_system_description_LANG).difference(cur_species_commonname_LANG)) miss_system_description = (set(cur_species_commonname_LANG).difference(cur_system_description_LANG)) if(len(miss_common_name) != 0): validation_log.append(["Missing language in SystemDescription :" + str(miss_common_name) +". File : " + path_xml_file +\ " with ModelType " + str(cur_modeltype) + " and System " + str(cur_system)])
sys.path.append("../") from autecology_xml import AutecologyXML #xmltest = AutecologyXML(filename = "../../../_knowledgerules/species/Birds/Phalacrocorax carbo.xml") #xmltest = AutecologyXML(filename = "../../../_knowledgerules/species/Molluscs/Dreissena_polymorpha.xml") xmltest = AutecologyXML( filename="../../../_knowledgerules/species/Birds/Gallinago_gallinago.xml") xmltest._readxml() print(type(xmltest.xmlroot)) xmltest._scan() testext = xmltest._read_topicdescription() print(type(testext)) xmltest._scan_modeltype("HSI") #xmltest._scan_knowledgerules(systemname = "adult") xmltest._scan_knowledgerules(modeltypename="HSI", systemname="adult") print(all(elem in xmltest.XMLconvention["allowed_knowledgeRulesCategories"] for elem \ in xmltest.knowledgeRulesCategories)) print(xmltest.knowledgeRulesNames) print(xmltest.knowledgeRulesCategories) #rc_tag = xmltest.get_element_response_curve(modeltypename = "HSI", systemname = "adult", rcname = "afstand_tot_moeras") #rc_tag = xmltest.get_element_response_curve(modeltypename = "HSI", systemname = "adult", rcname = "substrate_type") rc_tag = xmltest.get_element_response_curve(modeltypename="HSI", systemname="adult", rcname="water_storage_capacity") print(rc_tag) rc_data = xmltest.get_data_response_curve_data(rc_tag) print(rc_data) print(type(rc_data)) print(type(rc_data["rule"]))
import pandas sys.path.append("../") from autecology_xml import AutecologyXML xmltest = AutecologyXML( filename= "../../../_knowledgerules/Habitats/Vegetation_associations/Vegetationtypes_Northen_Delta.xml" ) xmltest._readxml() print(type(xmltest.xmlroot)) xmltest._scan() testext = xmltest._read_topicdescription() print(type(testext)) xmltest._scan_modeltype("HSI") xmltest._scan_knowledgerules(modeltypename="HSI", systemname="biesbosch_area") print(all(elem in xmltest.XMLconvention["allowed_knowledgeRulesCategories"] for elem \ in xmltest.knowledgeRulesCategories)) print(xmltest.systemname) print(xmltest.knowledgeRulesNr) print(xmltest.knowledgeRulesCategorie) print(xmltest.knowledgeRulesNames) print(xmltest.XMLconvention["allowed_knowledgeRulesNames"]) #TO DO: CREATE TABLE OUT OF MultipleReclassification mr_element = xmltest.get_element_multiple_reclassification( modeltypename="HSI", systemname="biesbosch_area", mrname="vegetationtypes_without_grazing") mr_data = xmltest.get_data_multiple_reclassification_data(mr_element)