Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Find overloaded terms and fix them if there are any #21

Closed
nllong opened this issue Mar 2, 2021 · 10 comments
Closed

Find overloaded terms and fix them if there are any #21

nllong opened this issue Mar 2, 2021 · 10 comments
Labels
documentation Improvements or additions to documentation

Comments

@nllong
Copy link
Member

nllong commented Mar 2, 2021

The was a result of the survey. Perhaps Bender. We should track down who said this and inquire.

@nllong nllong added the documentation Improvements or additions to documentation label Mar 2, 2021
@macintoshpie
Copy link

e.g. auc:Building
Screen Shot 2021-04-08 at 9 38 06 AM

@nllong
Copy link
Member Author

nllong commented Apr 8, 2021

oof, are we saying that Building is defined multiple times in the schema?

@macintoshpie
Copy link

Yep, seems to be the case for facility and site as well. Probably need to programmatically find these.

@nllong
Copy link
Member Author

nllong commented Apr 9, 2021

yep, not good. Can you whip up a script to find dups?

@macintoshpie
Copy link

We might want to integrate this into the CI

script, ran on develop branch schema

from collections import defaultdict
from pprint import pprint
from lxml import etree

ns_map = {
    'xs': 'http://www.w3.org/2001/XMLSchema'
}

element_names = defaultdict(list)

tree = etree.parse('BuildingSync.xsd')

named_elements = tree.xpath('//xs:element[@name]', namespaces=ns_map)
for elem in named_elements:
    element_names[elem.get('name')].append(elem.sourceline)

dupe_names = {name: lines for name, lines in element_names.items() if len(lines) > 1}

pprint(dupe_names)

duplicate element names (lists line numbers):

{'ActiveDehumidification': [6620, 8018, 8062],
 'AdvancedPowerStrip': [16927, 17083],
 'AnnualCoolingEfficiencyValue': [6668, 7954, 8030],
 'AnnualDemandSavingsCost': [2628, 5604],
 'AnnualHeatingEfficiencyValue': [6429, 7466, 7681, 7776],
 'AnnualPeakElectricityReduction': [2389, 2616, 2927, 5592],
 'AnnualSavingsByFuel': [2569, 5545],
 'AnnualSavingsByFuels': [2566, 5542],
 'AnnualSavingsCost': [2353, 2554, 2891, 5530],
 'AnnualSavingsNativeUnits': [2574, 5550],
 'AnnualSavingsSiteEnergy': [2329, 2530, 2867, 5506],
 'AnnualSavingsSourceEnergy': [2341, 2542, 2879, 5518],
 'AnnualWaterCostSavings': [2413, 2652, 2951, 5628],
 'AnnualWaterSavings': [2401, 2640, 2939, 5616],
 'AssemblyType': [11997, 12197],
 'BoilerLWT': [7568, 7706],
 'Building': [490, 14247, 14442],
 'BurnerQuantity': [6284, 7375],
 'BurnerTurndownRatio': [6297, 7392],
 'CBECS': [2234, 17553],
 'CDDBaseTemperature': [3117, 4550],
 'Capacity': [6467, 7434, 7667, 7762, 14079],
 'ChilledWaterSupplyTemperature': [8006, 8050],
 'ClimateZone': [16551, 17427, 17459, 17478, 17509, 17533, 17557, 17580],
 'ClothesWasherCapacity': [10461, 10549],
 'ClothesWasherModifiedEnergyFactor': [10437, 10525],
 'ClothesWasherWaterFactor': [10449, 10537],
 'Combustion': [9382, 9678],
 'CombustionEfficiency': [6313, 7479],
 'CommunicationProtocol': [17262, 17276],
 'CondenserPlantID': [6596, 7902, 10146],
 'CondenserPlantIDs': [6593, 7899, 10143],
 'CondenserWaterTemperature': [8221, 8354],
 'CondensingTemperature': [8156, 8233, 8366, 8447],
 'Control': [6511,
             6730,
             6973,
             8815,
             9328,
             9537,
             9873,
             10402,
             10624,
             10783,
             11017,
             11175,
             11278,
             13044,
             13145,
             13239,
             13323,
             13634,
             13757,
             13867],
 'ControlSensor': [16974, 17107, 17177],
 'ControlStrategy': [16934,
                     16954,
                     16979,
                     16999,
                     17019,
                     17044,
                     17087,
                     17124,
                     17144,
                     17193,
                     17213,
                     17235],
 'ControlSystemTypes': [7810, 8087, 8484],
 'Controls': [6505,
              6724,
              6967,
              8809,
              9322,
              9531,
              9867,
              10396,
              10618,
              10777,
              11011,
              11169,
              11272,
              13038,
              13139,
              13233,
              13317,
              13628,
              13751,
              13861],
 'ConveyanceSystems': [220, 5040],
 'CoolingSourceID': [6388, 6944],
 'CoolingStageCapacity': [6695, 7887],
 'DemandRatchetPercentage': [3193, 3386, 3551],
 'DemandRateAdjustment': [3241, 3362, 3527],
 'DemandWindow': [3181, 3374, 3539],
 'DryerElectricEnergyUsePerLoad': [10480, 10562],
 'DryerGasEnergyUsePerLoad': [10492, 10574],
 'ElectricDemandRate': [3229, 3338, 3503],
 'ElectricResistance': [6262, 9381, 9677],
 'EndTimestamp': [4443, 17903],
 'EndUse': [3884, 4114, 15910],
 'EnergyCostRate': [3205, 3326, 3491],
 'EnergyRateAdjustment': [3217, 3350, 3515],
 'EnergySellRate': [3253, 3404, 3569],
 'EnergyUse': [15823, 15901],
 'EquipmentDisposalAndSalvageCosts': [2705, 5664],
 'ExistingScheduleAffected': [4612, 4656, 4692, 4728],
 'ExteriorRoughness': [11520, 12550],
 'Facility': [64, 14185, 14380],
 'FanBased': [6768, 6928],
 'FenestrationArea': [17814, 17836],
 'FloorsAboveGrade': [672, 1574],
 'FloorsBelowGrade': [684, 1586],
 'FoundationHeightAboveGrade': [12747, 12830],
 'FoundationWallConstruction': [12742, 12825],
 'FoundationWallInsulationCondition': [12796, 12879],
 'FoundationWallInsulationThickness': [12759, 12842],
 'FoundationWallRValue': [12771, 12854],
 'FoundationWallUFactor': [12783, 12866],
 'FundingFromIncentives': [2753, 5676],
 'FundingFromTaxCredits': [2765, 5688],
 'HDDBaseTemperature': [3105, 4538],
 'HeatPump': [6341, 9408],
 'HeatingStageCapacityFraction': [6494, 7460],
 'HotWaterBoilerMaximumFlowRate': [7544, 7694],
 'InputCapacity': [6442, 7409],
 'InteriorVisibleAbsorptance': [11508, 12538],
 'InternalRateOfReturn': [2449, 2838, 2987, 5737],
 'IntervalFrequency': [4458, 17907],
 'LampLabel': [8876, 8909, 8947, 8969, 9002, 9036],
 'LampPower': [9183, 10227],
 'LinkedBuildingID': [14250, 14445],
 'LinkedFacilityID': [14188, 14383],
 'LinkedScheduleID': [14197,
                      14228,
                      14259,
                      14290,
                      14321,
                      14352,
                      14392,
                      14423,
                      14454,
                      14485,
                      14516,
                      14547],
 'LinkedScheduleIDs': [14194,
                       14225,
                       14256,
                       14287,
                       14318,
                       14349,
                       14389,
                       14420,
                       14451,
                       14482,
                       14513,
                       14544],
 'LinkedSectionID': [14281, 14476],
 'LinkedSiteID': [14219, 14414],
 'LinkedSpaceID': [14343, 14538],
 'LinkedSystemID': [10802, 11037, 11195, 14569],
 'LinkedSystemIDs': [10799, 11034, 11192],
 'LinkedThermalZoneID': [14312, 14507],
 'MVCost': [2681, 5752],
 'MakeupAirSourceID': [8663, 8734],
 'Manual': [16947, 17137],
 'MeasureName': [4806,
                 4836,
                 4864,
                 4888,
                 4939,
                 4974,
                 5010,
                 5046,
                 5071,
                 5096,
                 5121,
                 5147,
                 5174,
                 5200,
                 5234,
                 5260,
                 5282,
                 5305,
                 5329,
                 5352,
                 5380,
                 5406,
                 5425,
                 5439],
 'MinimumPartLoadRatio': [6707, 7973],
 'ModifiedSchedule': [4620, 4664, 4700, 4736],
 'NPVofTaxImplications': [2801, 5700],
 'NetPresentValue': [2437, 2826, 2975, 5725],
 'NoCooling': [6648, 8071],
 'NoHeating': [6408, 7794],
 'NumberOfDiscreteCoolingStages': [6683, 7875],
 'NumberOfHeatingStages': [6482, 7448],
 'OMCostAnnualSavings': [2693, 5640],
 'Occupancy': [16967, 17170],
 'Other': [2278,
           2863,
           3056,
           3629,
           6852,
           6932,
           8468,
           9391,
           9568,
           9576,
           9687,
           9698,
           10589,
           12285,
           12800,
           12934,
           13558,
           13974,
           13991,
           17290,
           17577],
 'OtherCombination': [6407, 6647, 7793, 8070, 8801, 9066],
 'OtherControlStrategyName': [16939,
                              16959,
                              16984,
                              17004,
                              17024,
                              17049,
                              17092,
                              17129,
                              17162,
                              17198,
                              17218,
                              17240],
 'OtherControlTechnology': [17032, 17226],
 'OtherControlTechnologyName': [17039, 17230],
 'OutputCapacity': [6455, 7422, 7655, 7750],
 'PipeInsulationThickness': [6785, 6825, 9753, 16649],
 'PipeLocation': [6797, 6837, 9765, 16661],
 'PortfolioManager': [655, 2233],
 'PrimaryFuel': [7800, 8077, 8474, 14054],
 'Priority': [2521, 16226],
 'RatePeriod': [3169, 3283, 3437],
 'RatePeriodName': [3172, 3286, 3440],
 'RatePeriods': [3166, 3280, 3434],
 'RatedCoolingSensibleHeatRatio': [6712, 7978, 8045],
 'RefrigerantChargeFactor': [6608, 7914],
 'RequiredVentilationRate': [8606, 8712],
 'Section': [1025, 14278, 14473],
 'SimplePayback': [2425, 2814, 2963, 5713],
 'Site': [73, 14216, 14411],
 'SiteEnergyUse': [4121, 15856],
 'SlabArea': [12577, 12881],
 'SlabExposedPerimeter': [12601, 12905],
 'SlabInsulationCondition': [12649, 12929],
 'SlabInsulationThickness': [12613, 12917],
 'SlabPerimeter': [12589, 12893],
 'SourceEnergyUse': [4145, 15863],
 'SourceEnergyUseIntensity': [4157, 15867],
 'Space': [1772, 14340, 14535],
 'SpaceID': [1381, 1449, 1517],
 'SpaceIDs': [1378, 1446, 1514],
 'StartTimestamp': [4438, 17902],
 'SteamBoilerMaximumOperatingPressure': [7608, 7730],
 'SteamBoilerMinimumOperatingPressure': [7596, 7718],
 'Story': [1089, 15640],
 'StreetAdditionalInfo': [14605, 14660],
 'SummerPeakElectricityReduction': [2365, 2592, 2903, 5568],
 'ThermalEfficiency': [6325, 7491],
 'ThermalZone': [1641, 14309, 14504],
 'ThermalZoneID': [1217, 1367, 1435, 1503],
 'ThermalZoneIDs': [1211, 1364, 1432, 1500],
 'TimeSeries': [3070, 18176, 18277, 18287, 18297, 18307],
 'Timer': [16992, 17206],
 'TransformerNeeded': [8991, 9047],
 'Unknown': [3634,
             6409,
             6649,
             7795,
             8072,
             8469,
             8802,
             9067,
             9392,
             9569,
             9577,
             9688,
             9699,
             10590,
             12801,
             12935],
 'UtilityAccountNumber': [3816, 13958],
 'UtilityBillpayer': [3821, 13963],
 'UtilityMeterNumber': [3808, 13953],
 'VentilationControlMethods': [8640, 8724, 8785],
 'VentilationRate': [8594, 8700],
 'WaterSideEconomizer': [8246, 8379],
 'WaterSideEconomizerDBTemperatureMaximum': [8265, 8410],
 'WaterSideEconomizerTemperatureMaximum': [8253, 8398],
 'WaterUse': [244, 4314],
 'WeightedAverageLoad': [13127, 13215],
 'WinterPeakElectricityReduction': [2377, 2604, 2915, 5580],
 'YearOfConstruction': [941, 1055]}

@nllong
Copy link
Member Author

nllong commented Apr 9, 2021

Some of these are true namespace conflicts (e.g., MeasureName); but it seems like a lot of these can be promoted in the schema to a common term (SimpleTypes/ComplexTypes). It seems like that is something that we should do, right? We will want to ensure that contextual they are the same thing because I imagine some of these are named the same but have different units or definitions...

@macintoshpie
Copy link

Yeah I think that's right. These are all "technically" different, but some actually have the exact same data structure that should reference a common type, and others need to have their names changed because they really aren't the same

@nllong
Copy link
Member Author

nllong commented Apr 12, 2021

Yeah I think that's right. These are all "technically" different, but some actually have the exact same data structure that should reference a common type, and others need to have their names changed because they really aren't the same

Okay. Sound like we should take this ticket and break it up into two: 1) convert common overloaded terms to simple/complex types and 2) remove overloaded terms.

For item 1. Is there an easy way to do this, or are we just going to need to sit down and look at them all? Maybe break them up by A-D, E-H, ..., and make tickets?

@macintoshpie
Copy link

That sounds good, I can break it out and make tickets.

@macintoshpie
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants