diff --git a/bricksrc/deprecations.py b/bricksrc/deprecations.py index bdad5ba4..897041a9 100644 --- a/bricksrc/deprecations.py +++ b/bricksrc/deprecations.py @@ -5,6 +5,7 @@ "version": "1.4.0", "mitigation_message": "Speed Status is no longer necessary. Use Speed Mode Status for motors with various categorical speed settings, such as low, medium, and high. To further clarify, points representing the current speed of a variable speed fan as an analog value or input, use Speed Sensor.", "replace_with": BRICK.Speed_Mode_Status, + RDFS.subClassOf: BRICK.Status, }, BRICK.Condenser: { "version": "1.3.0", @@ -15,6 +16,7 @@ "version": "1.4.0", "mitigation_message": "This class has a poor definition is supplanted by Temperature_Sensor", "replace_with": BRICK.Temperature_Sensor, + RDFS.subClassOf: BRICK.Sensor, }, BRICK.Trace_Heat_Sensor: { "version": "1.4.0", diff --git a/bricksrc/recpatches.ttl b/bricksrc/recpatches.ttl index eb11db54..67359f83 100644 --- a/bricksrc/recpatches.ttl +++ b/bricksrc/recpatches.ttl @@ -39,6 +39,14 @@ rec:Lobby rdfs:subClassOf rec:Room ; . +rec:Wing + rdf:type rdf:Class ; + rdf:type sh:NodeShape ; + rdfs:label "Wing" ; + rdfs:comment "This concept definition comes from the Brick distribution until it is added in the REC ontology Turtle distribution." ; + rdfs:subClassOf rec:Space ; +. + brick:Ablutions_Room owl:deprecated "true"^^xsd:boolean ; brick:isReplacedBy rec:Room ; @@ -48,25 +56,25 @@ brick:Ablutions_Room brick:Detention_Room owl:deprecated "true"^^xsd:boolean ; brick:isReplacedBy rec:Room ; - brick:deprecatedInVersion "1.4.0" ; + brick:deprecatedInVersion "1.4.1" ; brick:deprecationMitigationMessage "Brick location classes are being phased out in favor of RealEstateCore classes. There is not yet a replacement in REC for Detention_Room" ; . brick:Environment_Box owl:deprecated "true"^^xsd:boolean ; brick:isReplacedBy rec:Laboratory ; - brick:deprecatedInVersion "1.4.0" ; + brick:deprecatedInVersion "1.4.1" ; brick:deprecationMitigationMessage "Brick location classes are being phased out in favor of RealEstateCore classes. There is not yet a replacement in REC for Environment_Box" ; . brick:Field_Of_Play owl:deprecated "true"^^xsd:boolean ; brick:isReplacedBy rec:OutdoorSpace ; - brick:deprecatedInVersion "1.4.0" ; + brick:deprecatedInVersion "1.4.1" ; brick:deprecationMitigationMessage "Brick location classes are being phased out in favor of RealEstateCore classes. There is not yet a replacement in REC for Field_Of_Play" ; . brick:First_Aid_Room owl:deprecated "true"^^xsd:boolean ; brick:isReplacedBy rec:TreatmentRoom ; - brick:deprecatedInVersion "1.4.0" ; + brick:deprecatedInVersion "1.4.1" ; brick:deprecationMitigationMessage "Brick location classes are being phased out in favor of RealEstateCore classes. There is not yet a replacement in REC for First_Aid_Room" ; . brick:Freezer @@ -78,43 +86,43 @@ brick:Freezer brick:Gatehouse owl:deprecated "true"^^xsd:boolean ; brick:isReplacedBy rec:Building ; - brick:deprecatedInVersion "1.4.0" ; + brick:deprecatedInVersion "1.4.1" ; brick:deprecationMitigationMessage "Brick location classes are being phased out in favor of RealEstateCore classes. There is not yet a replacement in REC for Gatehouse" ; . brick:Hospitality_Box owl:deprecated "true"^^xsd:boolean ; brick:isReplacedBy rec:Room ; - brick:deprecatedInVersion "1.4.0" ; + brick:deprecatedInVersion "1.4.1" ; brick:deprecationMitigationMessage "Brick location classes are being phased out in favor of RealEstateCore classes. There is not yet a replacement in REC for Hospitality_Box" ; . brick:Hot_Box owl:deprecated "true"^^xsd:boolean ; brick:isReplacedBy rec:Room ; - brick:deprecatedInVersion "1.4.0" ; + brick:deprecatedInVersion "1.4.1" ; brick:deprecationMitigationMessage "Brick location classes are being phased out in favor of RealEstateCore classes. There is not yet a replacement in REC for Hot_Box" ; . brick:Information_Area owl:deprecated "true"^^xsd:boolean ; brick:isReplacedBy rec:Reception ; - brick:deprecatedInVersion "1.4.0" ; + brick:deprecatedInVersion "1.4.1" ; brick:deprecationMitigationMessage "Brick location classes are being phased out in favor of RealEstateCore classes. There is not yet a replacement in REC for Information_Area" ; . brick:Lighting_Zone owl:deprecated "true"^^xsd:boolean ; brick:isReplacedBy rec:Zone ; - brick:deprecatedInVersion "1.4.0" ; + brick:deprecatedInVersion "1.4.1" ; brick:deprecationMitigationMessage "Brick location classes are being phased out in favor of RealEstateCore classes. There is not yet a replacement in REC for Lighting_Zone" ; . brick:Loading_Dock owl:deprecated "true"^^xsd:boolean ; brick:isReplacedBy rec:LoadingReceivingRoom ; - brick:deprecatedInVersion "1.4.0" ; + brick:deprecatedInVersion "1.4.1" ; brick:deprecationMitigationMessage "Brick location classes are being phased out in favor of RealEstateCore classes. There is not yet a replacement in REC for Loading_Dock" ; . brick:Majlis owl:deprecated "true"^^xsd:boolean ; brick:isReplacedBy rec:Lounge ; - brick:deprecatedInVersion "1.4.0" ; + brick:deprecatedInVersion "1.4.1" ; brick:deprecationMitigationMessage "Brick location classes are being phased out in favor of RealEstateCore classes. There is not yet a replacement in REC for Majlis" ; . brick:Media_Room @@ -126,93 +134,87 @@ brick:Media_Room brick:Media_Hot_Desk owl:deprecated "true"^^xsd:boolean ; brick:isReplacedBy rec:RecordingRoom ; - brick:deprecatedInVersion "1.4.0" ; + brick:deprecatedInVersion "1.4.1" ; brick:deprecationMitigationMessage "Brick location classes are being phased out in favor of RealEstateCore classes. There is not yet a replacement in REC for Media_Hot_Desk" ; . brick:Media_Production_Room owl:deprecated "true"^^xsd:boolean ; brick:isReplacedBy rec:RecordingRoom ; - brick:deprecatedInVersion "1.4.0" ; + brick:deprecatedInVersion "1.4.1" ; brick:deprecationMitigationMessage "Brick location classes are being phased out in favor of RealEstateCore classes. There is not yet a replacement in REC for Media_Production_Room" ; . brick:Outside owl:deprecated "true"^^xsd:boolean ; brick:isReplacedBy rec:OutdoorSpace ; - brick:deprecatedInVersion "1.4.0" ; + brick:deprecatedInVersion "1.4.1" ; brick:deprecationMitigationMessage "Brick location classes are being phased out in favor of RealEstateCore classes. There is not yet a replacement in REC for Outside" ; . brick:Parking_Level owl:deprecated "true"^^xsd:boolean ; brick:isReplacedBy rec:Level ; - brick:deprecatedInVersion "1.4.0" ; + brick:deprecatedInVersion "1.4.1" ; brick:deprecationMitigationMessage "Brick location classes are being phased out in favor of RealEstateCore classes. There is not yet a replacement in REC for Parking_Level" ; . brick:Parking_Structure owl:deprecated "true"^^xsd:boolean ; brick:isReplacedBy rec:Building ; - brick:deprecatedInVersion "1.4.0" ; + brick:deprecatedInVersion "1.4.1" ; brick:deprecationMitigationMessage "Brick location classes are being phased out in favor of RealEstateCore classes. There is not yet a replacement in REC for Parking_Structure" ; . brick:Prayer_Room owl:deprecated "true"^^xsd:boolean ; brick:isReplacedBy rec:MeditationRoom ; - brick:deprecatedInVersion "1.4.0" ; + brick:deprecatedInVersion "1.4.1" ; brick:deprecationMitigationMessage "Brick location classes are being phased out in favor of RealEstateCore classes. There is not yet a replacement in REC for Prayer_Room" ; . brick:Pump_Room owl:deprecated "true"^^xsd:boolean ; brick:isReplacedBy rec:UtilitiesRoom ; - brick:deprecatedInVersion "1.4.0" ; + brick:deprecatedInVersion "1.4.1" ; brick:deprecationMitigationMessage "Brick location classes are being phased out in favor of RealEstateCore classes. There is not yet a replacement in REC for Pump_Room" ; . brick:Riser owl:deprecated "true"^^xsd:boolean ; brick:isReplacedBy rec:Room ; - brick:deprecatedInVersion "1.4.0" ; + brick:deprecatedInVersion "1.4.1" ; brick:deprecationMitigationMessage "Brick location classes are being phased out in favor of RealEstateCore classes. There is not yet a replacement in REC for Riser" ; . brick:Sports_Service_Room owl:deprecated "true"^^xsd:boolean ; brick:isReplacedBy rec:ExerciseRoom ; - brick:deprecatedInVersion "1.4.0" ; + brick:deprecatedInVersion "1.4.1" ; brick:deprecationMitigationMessage "Brick location classes are being phased out in favor of RealEstateCore classes. There is not yet a replacement in REC for Sports_Service_Room" ; . brick:Stage_Riser owl:deprecated "true"^^xsd:boolean ; brick:isReplacedBy rec:Room ; - brick:deprecatedInVersion "1.4.0" ; + brick:deprecatedInVersion "1.4.1" ; brick:deprecationMitigationMessage "Brick location classes are being phased out in favor of RealEstateCore classes. There is not yet a replacement in REC for Stage_Riser" ; . brick:TETRA_Room owl:deprecated "true"^^xsd:boolean ; brick:isReplacedBy rec:TelecommunicationRoom ; - brick:deprecatedInVersion "1.4.0" ; + brick:deprecatedInVersion "1.4.1" ; brick:deprecationMitigationMessage "Brick location classes are being phased out in favor of RealEstateCore classes. There is not yet a replacement in REC for TETRA_Room" ; . brick:Ticketing_Booth owl:deprecated "true"^^xsd:boolean ; brick:isReplacedBy rec:Building ; - brick:deprecatedInVersion "1.4.0" ; + brick:deprecatedInVersion "1.4.1" ; brick:deprecationMitigationMessage "Brick location classes are being phased out in favor of RealEstateCore classes. There is not yet a replacement in REC for Ticketing_Booth" ; . brick:Tunnel owl:deprecated "true"^^xsd:boolean ; brick:isReplacedBy rec:Room ; - brick:deprecatedInVersion "1.4.0" ; + brick:deprecatedInVersion "1.4.1" ; brick:deprecationMitigationMessage "Brick location classes are being phased out in favor of RealEstateCore classes. There is not yet a replacement in REC for Tunnel" ; . brick:Water_Tank owl:deprecated "true"^^xsd:boolean ; brick:isReplacedBy rec:UtilitiesRoom ; - brick:deprecatedInVersion "1.4.0" ; + brick:deprecatedInVersion "1.4.1" ; brick:deprecationMitigationMessage "Brick location classes are being phased out in favor of RealEstateCore classes. There is not yet a replacement in REC for Water_Tank" ; . -brick:Vertical_Space - owl:deprecated "true"^^xsd:boolean ; - brick:isReplacedBy rec:ElevatorShaft ; - brick:deprecatedInVersion "1.4.0" ; - brick:deprecationMitigationMessage "Brick location classes are being phased out in favor of RealEstateCore classes. There is not yet a replacement in REC for Vertical_Space" ; -. brick:Absolute_Humidity_Sensor rdf:type owl:Class ; rdf:type sh:NodeShape ; @@ -441,9 +443,6 @@ brick:Demand_Sensor sh:nodeKind sh:IRI ; ] ; . -brick:Detention_Room - owl:deprecated "true"^^xsd:boolean ; -. brick:Dewpoint_Sensor sh:property [ rdf:type sh:PropertyShape ; @@ -454,9 +453,6 @@ brick:Dewpoint_Sensor sh:nodeKind sh:IRI ; ] ; . -brick:Differential_Temperature_Setpoint - rdf:type sh:NodeShape ; -. brick:Direction_Sensor sh:property [ rdf:type sh:PropertyShape ; @@ -545,9 +541,6 @@ brick:Entrance brick:deprecationMitigationMessage "Brick location classes are being phased out in favor of RealEstateCore classes. For a replacement, consider rec:Entrance" ; brick:isReplacedBy rec:Entrance ; . -brick:Environment_Box - owl:deprecated "true"^^xsd:boolean ; -. brick:Equipment rdfs:subClassOf rec:Asset ; sh:property [ @@ -575,9 +568,6 @@ brick:Exercise_Room brick:deprecationMitigationMessage "Brick location classes are being phased out in favor of RealEstateCore classes. For a replacement, consider rec:ExerciseRoom" ; brick:isReplacedBy rec:ExerciseRoom ; . -brick:Field_Of_Play - owl:deprecated "true"^^xsd:boolean ; -. brick:Fire_Sensor sh:property [ rdf:type sh:PropertyShape ; @@ -594,9 +584,6 @@ brick:Fire_Zone brick:deprecationMitigationMessage "Brick location classes are being phased out in favor of RealEstateCore classes. For a replacement, consider rec:ServiceEntrance" ; brick:isReplacedBy rec:ServiceEntrance ; . -brick:First_Aid_Room - owl:deprecated "true"^^xsd:boolean ; -. brick:Floor owl:deprecated "true"^^xsd:boolean ; brick:deprecatedInVersion "1.4.0" ; @@ -619,9 +606,6 @@ brick:Food_Service_Room brick:deprecationMitigationMessage "Brick location classes are being phased out in favor of RealEstateCore classes. For a replacement, consider rec:FoodHandlingRoom" ; brick:isReplacedBy rec:FoodHandlingRoom ; . -brick:Freezer - owl:deprecated "true"^^xsd:boolean ; -. brick:Frequency_Sensor sh:property [ rdf:type sh:PropertyShape ; @@ -658,9 +642,6 @@ brick:Gas_Sensor sh:nodeKind sh:IRI ; ] ; . -brick:Gatehouse - owl:deprecated "true"^^xsd:boolean ; -. brick:Generation_Sensor sh:property [ rdf:type sh:PropertyShape ; @@ -701,7 +682,7 @@ brick:Hallway . brick:Hazardous_Materials_Storage owl:deprecated "true"^^xsd:boolean ; - brick:deprecatedInVersion "1.4.0" ; + brick:deprecatedInVersion "1.4.1" ; brick:deprecationMitigationMessage "Brick location classes are being phased out in favor of RealEstateCore classes. There is not yet a replacement in REC for Hazardous_Materials_Storage" ; brick:isReplacedBy rec:Room ; . @@ -715,12 +696,6 @@ brick:Heat_Sensor sh:nodeKind sh:IRI ; ] ; . -brick:Hospitality_Box - owl:deprecated "true"^^xsd:boolean ; -. -brick:Hot_Box - owl:deprecated "true"^^xsd:boolean ; -. brick:IDF owl:deprecated "true"^^xsd:boolean ; brick:deprecatedInVersion "1.4.0" ; @@ -747,9 +722,6 @@ brick:Imbalance_Sensor sh:nodeKind sh:IRI ; ] ; . -brick:Information_Area - owl:deprecated "true"^^xsd:boolean ; -. brick:Janitor_Room owl:deprecated "true"^^xsd:boolean ; brick:deprecatedInVersion "1.4.0" ; @@ -768,15 +740,6 @@ brick:Library brick:deprecationMitigationMessage "Brick location classes are being phased out in favor of RealEstateCore classes. For a replacement, consider rec:Library" ; brick:isReplacedBy rec:Library ; . -brick:Lighting - rdf:type sh:NodeShape ; -. -brick:Lighting_Zone - owl:deprecated "true"^^xsd:boolean ; -. -brick:Loading_Dock - owl:deprecated "true"^^xsd:boolean ; -. brick:Lobby owl:deprecated "true"^^xsd:boolean ; brick:deprecatedInVersion "1.4.0" ; @@ -828,9 +791,6 @@ brick:Mail_Room brick:deprecationMitigationMessage "Brick location classes are being phased out in favor of RealEstateCore classes. For a replacement, consider rec:MailRoom" ; brick:isReplacedBy rec:MailRoom ; . -brick:Majlis - owl:deprecated "true"^^xsd:boolean ; -. brick:Massage_Room owl:deprecated "true"^^xsd:boolean ; brick:deprecatedInVersion "1.4.0" ; @@ -843,15 +803,6 @@ brick:Mechanical_Room brick:deprecationMitigationMessage "Brick location classes are being phased out in favor of RealEstateCore classes. For a replacement, consider rec:UtilitiesRoom" ; brick:isReplacedBy rec:UtilitiesRoom ; . -brick:Media_Hot_Desk - owl:deprecated "true"^^xsd:boolean ; -. -brick:Media_Production_Room - owl:deprecated "true"^^xsd:boolean ; -. -brick:Media_Room - owl:deprecated "true"^^xsd:boolean ; -. brick:Medical_Room owl:deprecated "true"^^xsd:boolean ; brick:deprecatedInVersion "1.4.0" ; @@ -912,9 +863,6 @@ brick:Outdoor_Area brick:deprecationMitigationMessage "Brick location classes are being phased out in favor of RealEstateCore classes. For a replacement, consider rec:OutdoorSpace" ; brick:isReplacedBy rec:OutdoorSpace ; . -brick:Outside - owl:deprecated "true"^^xsd:boolean ; -. brick:PV_Array rdfs:subClassOf rec:Collection ; sh:property [ @@ -936,18 +884,12 @@ brick:Parameter sh:nodeKind sh:IRI ; ] ; . -brick:Parking_Level - owl:deprecated "true"^^xsd:boolean ; -. brick:Parking_Space owl:deprecated "true"^^xsd:boolean ; brick:deprecatedInVersion "1.4.0" ; brick:deprecationMitigationMessage "Brick location classes are being phased out in favor of RealEstateCore classes. For a replacement, consider rec:ParkingSpace" ; brick:isReplacedBy rec:ParkingSpace ; . -brick:Parking_Structure - owl:deprecated "true"^^xsd:boolean ; -. brick:Photovoltaic_Array owl:deprecated "true"^^xsd:boolean ; . @@ -1025,9 +967,6 @@ brick:Power_Sensor sh:nodeKind sh:IRI ; ] ; . -brick:Prayer_Room - owl:deprecated "true"^^xsd:boolean ; -. brick:Pressure_Sensor sh:property [ rdf:type sh:PropertyShape ; @@ -1044,9 +983,6 @@ brick:Private_Office brick:deprecationMitigationMessage "Brick location classes are being phased out in favor of RealEstateCore classes. For a replacement, consider rec:Office" ; brick:isReplacedBy rec:Office ; . -brick:Pump_Room - owl:deprecated "true"^^xsd:boolean ; -. brick:Rain_Level_Sensor sh:property [ rdf:type sh:PropertyShape ; @@ -1117,9 +1053,6 @@ brick:Retail_Room brick:deprecationMitigationMessage "Brick location classes are being phased out in favor of RealEstateCore classes. For a replacement, consider rec:RetailRoom" ; brick:isReplacedBy rec:RetailRoom ; . -brick:Riser - owl:deprecated "true"^^xsd:boolean ; -. brick:Rooftop owl:deprecated "true"^^xsd:boolean ; brick:deprecatedInVersion "1.4.0" ; @@ -1204,12 +1137,6 @@ brick:Speed_Sensor sh:nodeKind sh:IRI ; ] ; . -brick:Sports_Service_Room - owl:deprecated "true"^^xsd:boolean ; -. -brick:Stage_Riser - owl:deprecated "true"^^xsd:boolean ; -. brick:Staircase owl:deprecated "true"^^xsd:boolean ; brick:deprecatedInVersion "1.4.0" ; @@ -1264,9 +1191,6 @@ brick:Collection sh:nodeKind sh:IRI ; ] ; . -brick:TETRA_Room - owl:deprecated "true"^^xsd:boolean ; -. brick:Team_Room owl:deprecated "true"^^xsd:boolean ; brick:deprecatedInVersion "1.4.0" ; @@ -1289,9 +1213,6 @@ brick:Temperature_Sensor sh:nodeKind sh:IRI ; ] ; . -brick:Ticketing_Booth - owl:deprecated "true"^^xsd:boolean ; -. brick:Torque_Sensor sh:property [ rdf:type sh:PropertyShape ; @@ -1308,9 +1229,6 @@ brick:Transformer_Room brick:deprecationMitigationMessage "Brick location classes are being phased out in favor of RealEstateCore classes. For a replacement, consider rec:UtilitiesRoom" ; brick:isReplacedBy rec:UtilitiesRoom ; . -brick:Tunnel - owl:deprecated "true"^^xsd:boolean ; -. brick:Usage_Sensor sh:property [ rdf:type sh:PropertyShape ; @@ -1323,7 +1241,7 @@ brick:Usage_Sensor . brick:Vertical_Space owl:deprecated "true"^^xsd:boolean ; - brick:deprecatedInVersion "1.4.0" ; + brick:deprecatedInVersion "1.4.1" ; brick:deprecationMitigationMessage "Brick location classes are being phased out in favor of RealEstateCore classes. There is not yet a replacement in REC for Vertical_Space" ; brick:isReplacedBy rec:Room ; . @@ -1371,6 +1289,9 @@ brick:Water_Tank . brick:Wing owl:deprecated "true"^^xsd:boolean ; + brick:deprecatedInVersion "1.4.1" ; + brick:deprecationMitigationMessage "Brick location classes are being phased out in favor of RealEstateCore classes. For a replacement, consider rec:Wing" ; + brick:isReplacedBy rec:Wing ; . brick:Workshop owl:deprecated "true"^^xsd:boolean ; diff --git a/pyproject.toml b/pyproject.toml index a2177d93..878486a3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -23,6 +23,18 @@ dev-dependencies = [ "html5lib>=1.1", "pyontoenv>=0.1.9a6", "brickschema[topquadrant]>=0.7.6a2", + "scipy>=1.13.1", + "sentence-transformers>=3.0.1", + "numpy>=2.0.1", ] -[tool.uv.workspace] -members = [] + +[build-system] +requires = ["hatchling"] +build-backend = "hatchling.build" + +[tool.rye] +managed = true +dev-dependencies = [] + +[tool.hatch.metadata] +allow-direct-references = true diff --git a/tools/compare_versions/compare_versions.py b/tools/compare_versions/compare_versions.py index 52abe7f4..1a225c11 100644 --- a/tools/compare_versions/compare_versions.py +++ b/tools/compare_versions/compare_versions.py @@ -10,7 +10,6 @@ dirname = Path(__file__).resolve().parent.parent.parent sys.path.append(str(dirname)) -from bricksrc.deprecations import deprecations import semver from rdflib import Graph, OWL, RDF, RDFS, Namespace, SKOS @@ -28,11 +27,12 @@ def get_root(version): short_version = get_short_version(version) if short_version == "1.3": return "https://brickschema.org/schema/Brick#Class" - if short_version == "1.4": - return "https://brickschema.org/schema/Brick#Entity" if semver.compare(version, "1.0.3") > 0: # if current version is newer than 1.0.3 return f"https://brickschema.org/schema/{short_version}/Brick#Class" - return f"https://brickschema.org/schema/{short_version}/BrickFrame#TagSet" + if semver.compare(version, "1.0.3") <= 0: # if current version is older than 1.0.3 + return f"https://brickschema.org/schema/{short_version}/BrickFrame#TagSet" + # 1.4 and later + return "https://brickschema.org/schema/Brick#Entity" argparser = argparse.ArgumentParser() @@ -175,6 +175,23 @@ def prep_concept(graph, concept): distance_matrix = 1 - similarities row_ind, col_ind = linear_sum_assignment(distance_matrix) +# fetch all deprecations from Brick +deprecations = {} +qstr = """ +SELECT ?s ?version ?message ?replacement WHERE { + ?s owl:deprecated true . + ?s brick:deprecatedInVersion ?version . + ?s brick:deprecationMitigationMessage ?message . + ?s brick:isReplacedBy ?replacement . +} +""" +for row in new_brick.query(qstr): + deprecations[row[0]] = { + "version": row[1], + "message": row[2], + "replacement": row[3], + } + mapping = {} for i, j in zip(row_ind, col_ind): score = similarities[i, j] @@ -189,6 +206,26 @@ def prep_concept(graph, concept): with open(history_dir / "mapping.json", "w") as fp: json.dump(mapping, fp) -# write deprecations to json file -with open(history_dir / "deprecations.json", "w") as fp: - json.dump(deprecations, fp) +# remove deprecations that are not new +for row in old_brick.query(qstr): + if row[0] in deprecations: + del deprecations[row[0]] + +# output the Markdown-formatted release notes + +# output added classes +with open(history_dir / "release_notes.md", "w") as fp: + fp.write("## Added Concepts\n\n```\n") + for c in sorted(set(new_classes) - set(old_classes)): + fp.write(f"{c}") + fp.write("\n```\n") + + fp.write("\n\n## Removed Concepts\n\n```\n") + for c in sorted(set(old_classes) - set(new_classes)): + fp.write(f"{c}") + fp.write("\n```\n") + + fp.write("\n\n## Deprecations\n\n") + fp.write("
\nDeprecations JSON\n\n```json\n") + json.dump(deprecations, fp, indent=2) + fp.write("\n```\n")