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

Provide a bespoke message for each items that cannot be upgraded automatically #134

Merged
merged 23 commits into from
Feb 3, 2021

Conversation

adecler
Copy link
Member

@adecler adecler commented Jan 22, 2021

NOTE: Depends on

BHoM/BHoM_Engine#2273

Issues addressed by this PR

Closes #117

It is now possible to add a custom message for the objects, types, and methods that are impossible to update automatically. Here's the two possible categories provided (each corresponding to a new section of the Versioning_X.json files) :

  • MessageForDeleted: The item was deleted and has no replacement in the new version. Provide a message that explains how best the user can replicate the previous behaviour. If completely impossible, suggest the possibility to raise an issue on GitHub (provide a link)
  • MessageForNoUpgrade: An alternative to this item can be found in the new version but it is not possible to provide an automatic upgrade because the upgrade requires missing critical information or decisions from the user.

I will add comments below for additional information about the items from version 3.3 that still need work in order to be versioned properly.

Test files

https://burohappold.sharepoint.com/:u:/r/sites/BHoM/02_Current/12_Scripts/02_Pull%20Request/BHoM/Versioning_Toolkit/%23133-Forward%20Versioning/VerifyVersioning%20-%2033.gh?csf=1&web=1&e=Rcn98E

Additional comments

Since we are already in version 4.1, I have manually added the upgrades in Versioning_Toolkit\BHoMUpgrader40\Upgrades.json. I will explain in a separate comment how to add the missing upgrades for methods (objects and types are already done).

@adecler
Copy link
Member Author

adecler commented Jan 22, 2021

All objects and types from 3.3 should now work correctly (or have a custom message explaining to the user what to do). Here's the list of objects that still need fixing and the corresponding issue raised:

@adecler
Copy link
Member Author

adecler commented Jan 22, 2021

Below is the list of methods from 3.3 that are still not deserialising correctly.

Failing methods from 3.3
  • BH.Engine.Adapters.CarbonQueryDatabase.Create.CarbonQueryDatabaseRequest(System.String, System.String, BH.oM.Base.CustomObject)
  • BH.Engine.Adapters.DIALux.Convert.FromDialUXOpening(System.Collections.Generic.List<System.String>, BH.oM.Environment.Elements.Panel, System.Collections.Generic.List<BH.oM.Environment.Elements.Panel>)
  • BH.Engine.Adapters.DIALux.Convert.FromDialUXOpeningType(System.String)
  • BH.Engine.Adapters.DIALux.Convert.FromDialUXPoint(System.String)
  • BH.Engine.Adapters.DIALux.Convert.FromDialUXSpace(System.Collections.Generic.List<System.String>)
  • BH.Engine.Adapters.DIALux.Convert.ToDIALux(BH.oM.Environment.Elements.Opening)
  • BH.Engine.Adapters.DIALux.Convert.ToDialUX(BH.oM.Environment.Elements.OpeningType)
  • BH.Engine.Adapters.DIALux.Convert.ToDialUX(BH.oM.Geometry.Point, System.Int32, System.Boolean)
  • BH.Engine.Adapters.DIALux.Convert.ToDialUX(System.Collections.Generic.List<BH.oM.Environment.Elements.Panel>)
  • BH.Engine.Adapters.ETABS.Compute.UpgradeVersion(BH.oM.Architecture.Elements.Level)
  • BH.Engine.Adapters.ETABS.Compute.UpgradeVersion(System.Collections.Generic.List<BH.oM.Architecture.Elements.Level>)
  • BH.Engine.Adapters.ETABS.Convert.ToCSI(BH.oM.Structure.Constraints.BarRelease, System.Boolean[]&, System.Double[]&, System.Boolean[]&, System.Double[]&)
  • BH.Engine.Adapters.ETABS.Convert.ToCSI(BH.oM.Structure.Constraints.Constraint6DOF, System.Boolean[]&, System.Double[]&)
  • BH.Engine.Adapters.ETABS.Convert.ToDoubleArray(BH.oM.Geometry.Vector)
  • BH.Engine.Adapters.ETABS.Convert.ToVector(System.Double[])
  • BH.Engine.Adapters.IES.Modify.RoundedPoint(BH.oM.Geometry.Point, System.Int32)
  • BH.Engine.Adapters.Revit.Create.BuildingElement(System.Collections.Generic.IEnumerable<BH.oM.Geometry.Point>, BH.oM.Environment.Elements.PanelType, System.String)
  • BH.Engine.Adapters.Revit.Modify.SetFamilyLibrary(BH.oM.Adapters.Revit.Settings.FamilyLoadSettings, BH.oM.Adapters.Revit.FamilyLibrary)
  • BH.Engine.Adapters.Revit.Modify.SetFamilyLibrary(BH.oM.Adapters.Revit.Settings.RevitSettings, BH.oM.Adapters.Revit.FamilyLibrary)
  • BH.Engine.Adapters.Revit.Query.InnerPolyCurves(BH.oM.Geometry.PolyCurve, System.Collections.Generic.IEnumerable<BH.oM.Geometry.PolyCurve>)
  • BH.Engine.Adapters.Revit.Query.OuterPolyCurves(System.Collections.Generic.IEnumerable<BH.oM.Geometry.PolyCurve>)
  • BH.Engine.Adapters.Robot.Compute.GroupBarsByLength(System.Collections.Generic.IEnumerable<BH.oM.Structure.Elements.Bar>, System.Double)
  • BH.Engine.Adapters.TAS.Create.BHoMObject(System.Int32)
  • BH.Engine.Adapters.TAS.Create.BuildingElement(System.Int32)
  • BH.Engine.Adapters.TAS.Modify.UpdateCustomDataValue(BH.oM.Base.IBHoMObject, System.String, System.Object)
  • BH.Engine.Adapters.TAS.Query.IsExternal(BH.oM.Environment.Elements.Panel)
  • BH.Engine.Adapters.TAS.Query.SurfaceType(BH.oM.Environment.Elements.Panel)
  • BH.Engine.Adapters.XML.Create.XMLSettings(System.Boolean, System.Boolean, System.Boolean, System.Boolean, System.Boolean, BH.oM.Adapters.XML.Enums.UnitType, BH.oM.Adapters.XML.Enums.ExportDetail, System.Double, System.Double)
  • BH.Engine.Adapters.XML.Create.XMLSettings(System.Boolean, System.Boolean, System.Boolean, System.Boolean, System.Boolean, BH.oM.Adapters.XML.Enums.UnitType, BH.oM.Adapters.XML.Enums.ExportDetail, System.Double, System.Double, System.Double)
  • BH.Engine.Architecture.Modify.SetGeometry(BH.oM.Architecture.Elements.Grid, BH.oM.Geometry.ICurve)
  • BH.Engine.Base.Query.TryGetValue(BH.oM.Base.FragmentSet, System.Type, null)
  • BH.Engine.BuildingEnvironment.Convert.ToConstruction(BH.oM.Base.CustomObject)
  • BH.Engine.BuildingEnvironment.Convert.ToGasMaterial(BH.oM.Base.CustomObject)
  • BH.Engine.BuildingEnvironment.Convert.ToLayer(BH.oM.Base.CustomObject)
  • BH.Engine.BuildingEnvironment.Convert.ToMaterial(BH.oM.Base.CustomObject)
  • BH.Engine.BuildingEnvironment.Convert.ToSolidMaterial(BH.oM.Base.CustomObject)
  • BH.Engine.ClimateEmergency.Compute.PlumbingFixtureWaterDemandPerDay(null, null, BH.oM.Base.CustomObject)
  • BH.Engine.ClimateEmergency.Create.BuildingOccupancyByGender(System.Int32, System.Double, System.Double, System.Double)
  • BH.Engine.ClimateEmergency.Create.BuildingPlumbingFixtureSelection(System.Double, System.Double, System.Double, System.Double, System.Double)
  • BH.Engine.Diffing.Compute.DiffGenericObjects(System.Collections.Generic.IEnumerable<System.Object>, System.Collections.Generic.IEnumerable<System.Object>, null, System.Boolean)
  • BH.Engine.Diffing.Compute.Diffing(System.Collections.Generic.IEnumerable<System.Object>, System.Collections.Generic.IEnumerable<System.Object>, null, System.String)
  • BH.Engine.Diffing.Compute.DiffingHash(System.Object, null)
  • BH.Engine.Diffing.Compute.DiffOneByOne(System.Collections.Generic.IEnumerable<System.Object>, System.Collections.Generic.IEnumerable<System.Object>, null, System.Boolean)
  • BH.Engine.Diffing.Compute.DiffRevisions(BH.oM.Diffing.Revision, BH.oM.Diffing.Revision, null)
  • BH.Engine.Diffing.Compute.DiffWithCustomId(System.Collections.Generic.IEnumerable<BH.oM.Base.IBHoMObject>, System.Collections.Generic.IEnumerable<BH.oM.Base.IBHoMObject>, System.String, null)
  • BH.Engine.Diffing.Compute.DiffWithFragmentId(System.Collections.Generic.IEnumerable<BH.oM.Base.IBHoMObject>, System.Collections.Generic.IEnumerable<BH.oM.Base.IBHoMObject>, System.Type, System.String, null)
  • BH.Engine.Diffing.Create.DiffConfig(System.Boolean, System.Boolean)
  • BH.Engine.Diffing.Create.DiffConfig(System.Boolean, System.Boolean, System.Collections.Generic.List<System.String>, System.Collections.Generic.List<System.String>, System.Collections.Generic.List<System.String>)
  • BH.Engine.Diffing.Modify.PrepareForRevision(System.Collections.Generic.IEnumerable<BH.oM.Base.IBHoMObject>, null)
  • BH.Engine.Diffing.Modify.RemoveDuplicatesByHash(System.Collections.Generic.IEnumerable<BH.oM.Base.IBHoMObject>)
  • BH.Engine.Diffing.Modify.SetHashFragment(BH.oM.Base.IBHoMObject, null)
  • BH.Engine.Diffing.Modify.SetHashFragment(BH.oM.Base.IBHoMObject, System.String)
  • BH.Engine.Diffing.Modify.SetHashFragment(System.Collections.Generic.IEnumerable<BH.oM.Base.IBHoMObject>, null)
  • BH.Engine.Diffing.Query.AnyDuplicateByHash(System.Collections.Generic.IEnumerable<BH.oM.Base.IBHoMObject>)
  • BH.Engine.Diffing.Query.DifferentProperties(System.Object, System.Object, null)
  • BH.Engine.Diffing.Query.GetHashFragment(BH.oM.Base.IBHoMObject)
  • BH.Engine.Environment.Create.Layer(System.String, BH.oM.Physical.Materials.Material, System.Double)
  • BH.Engine.Environment.Modify.UpdatePanelTypeByCustomData(System.Collections.Generic.List<BH.oM.Environment.Elements.Panel>, System.String)
  • BH.Engine.Geometry.Create.AngleProfileCurves(System.Double, System.Double, System.Double, System.Double, System.Double, System.Double)
  • BH.Engine.Geometry.Create.BoxProfileCurves(System.Double, System.Double, System.Double, System.Double, System.Double, System.Double)
  • BH.Engine.Geometry.Create.ChannelProfileCurves(System.Double, System.Double, System.Double, System.Double, System.Double, System.Double)
  • BH.Engine.Geometry.Create.CircleProfileCurves(System.Double)
  • BH.Engine.Geometry.Create.FabricatedBoxProfileCurves(System.Double, System.Double, System.Double, System.Double, System.Double, System.Double)
  • BH.Engine.Geometry.Create.GeneralisedFabricatedBoxProfileCurves(System.Double, System.Double, System.Double, System.Double, System.Double, System.Double, System.Double, System.Double, System.Double)
  • BH.Engine.Geometry.Create.GeneralisedTeeProfileCurves(System.Double, System.Double, System.Double, System.Double, System.Double, System.Double)
  • BH.Engine.Geometry.Create.IProfileCurves(System.Double, System.Double, System.Double, System.Double, System.Double, System.Double, System.Double, System.Double, System.Double)
  • BH.Engine.Geometry.Create.KiteProfileCurves(System.Double, System.Double, System.Double)
  • BH.Engine.Geometry.Create.RectangleProfileCurves(System.Double, System.Double, System.Double)
  • BH.Engine.Geometry.Create.TeeProfileCurves(System.Double, System.Double, System.Double, System.Double, System.Double, System.Double)
  • BH.Engine.Geometry.Create.TubeProfileCurves(System.Double, System.Double)
  • BH.Engine.Geometry.Create.ZSectionProfile(System.Double, System.Double, System.Double, System.Double, System.Double, System.Double)
  • BH.Engine.LifeCycleAssessment.Compute.EvaluateEnvironmentalProductDeclarationByArea(BH.oM.Base.IBHoMObject, BH.oM.LifeCycleAssessment.EnvironmentalProductDeclarationField, System.Double)
  • BH.Engine.LifeCycleAssessment.Compute.EvaluateEnvironmentalProductDeclarationByMass(BH.oM.Base.IBHoMObject, BH.oM.LifeCycleAssessment.EnvironmentalProductDeclarationField, System.Double)
  • BH.Engine.LifeCycleAssessment.Compute.EvaluateEnvironmentalProductDeclarationByVolume(BH.oM.Base.IBHoMObject, BH.oM.LifeCycleAssessment.EnvironmentalProductDeclarationField, System.Double)
  • BH.Engine.LifeCycleAssessment.Compute.MaterialEndOfLifeTreatment(BH.oM.Base.CustomObject)
  • BH.Engine.MachineLearning.Compute.Infer(BH.oM.MachineLearning.LinearRegression, BH.oM.MachineLearning.Tensor)
  • BH.Engine.MachineLearning.Compute.Infer(BH.oM.MachineLearning.MinMaxScaler, BH.oM.MachineLearning.Tensor)
  • BH.Engine.MachineLearning.Compute.Infer(BH.oM.MachineLearning.PolynomialFeatures, BH.oM.MachineLearning.Tensor)
  • BH.Engine.MachineLearning.Compute.Infer(BH.oM.MachineLearning.StandardScaler, BH.oM.MachineLearning.Tensor)
  • BH.Engine.MachineLearning.Compute.InferInverse(BH.oM.MachineLearning.MinMaxScaler, BH.oM.MachineLearning.Tensor)
  • BH.Engine.MachineLearning.Compute.InferInverse(BH.oM.MachineLearning.StandardScaler, BH.oM.MachineLearning.Tensor)
  • BH.Engine.MachineLearning.Compute.InstallMachineLearningToolkit(System.Boolean, System.Boolean)
  • BH.Engine.MachineLearning.Compute.Invoke(System.String, System.Collections.Generic.Dictionary<System.String, System.Object>)
  • BH.Engine.MachineLearning.Compute.Invoke(System.String, System.Object[])
  • BH.Engine.MachineLearning.Compute.InvokeNumpy(System.String, System.Collections.Generic.IEnumerable<System.Object>, System.Collections.Generic.Dictionary<System.String, System.Object>)
  • BH.Engine.MachineLearning.Compute.InvokeNumpy(System.String, System.Object[])
  • BH.Engine.MachineLearning.Compute.LinearRegression(BH.oM.MachineLearning.Tensor, BH.oM.MachineLearning.Tensor)
  • BH.Engine.MachineLearning.Compute.LoadCsv(System.String, System.String, System.Boolean)
  • BH.Engine.MachineLearning.Compute.MinMaxScaler(BH.oM.MachineLearning.Tensor)
  • BH.Engine.MachineLearning.Compute.PolynomialFeatures(System.Int32, System.Boolean)
  • BH.Engine.MachineLearning.Compute.StandardScaler(BH.oM.MachineLearning.Tensor)
  • BH.Engine.MEP.Modify.SetGeometry(null, BH.oM.Geometry.Point)
  • BH.Engine.MEP.Query.EquipmentLengthByPart(System.Collections.Generic.List<BH.oM.Base.CustomObject>)
  • BH.Engine.PerformanceDashboard.Create.Space(System.String, BH.oM.Environment.Elements.SpaceType, System.Double)
  • BH.Engine.Python.Query.TryImport(System.String)
  • BH.Engine.Representation.Modify.SetRendermesh(BH.oM.Base.IBHoMObject, BH.oM.Geometry.IGeometry, System.String)
  • BH.Engine.Representation.Query.TryGetRendermesh(BH.oM.Base.IBHoMObject, null, System.String)
  • BH.Engine.Structure.Create.NewElement0D(BH.oM.Structure.Elements.Bar, BH.oM.Geometry.Point)
  • BH.Engine.Structure.Create.NewElement1D(BH.oM.Structure.Elements.Opening, BH.oM.Geometry.ICurve)
  • BH.Engine.Structure.Create.NewElement1D(BH.oM.Structure.Elements.Panel, BH.oM.Geometry.ICurve)
  • BH.Engine.Structure.Query.HasAssignedObjectIds(BH.oM.Structure.Loads.IElementLoad<BH.oM.Base.IBHoMObject>, System.String)
  • BH.Engine.Structure.Results.Query.MapResults(System.Collections.Generic.IEnumerable<BH.oM.Base.IBHoMObject>, System.Collections.Generic.IEnumerable<BH.oM.Analytical.Results.IResult>, BH.oM.Structure.Results.MapResultsBy, System.String, System.Collections.Generic.List<System.String>)
  • BH.Engine.Structure.Results.Query.MapResults(System.Collections.Generic.IEnumerable<BH.oM.Base.IBHoMObject>, System.Collections.Generic.IEnumerable<BH.oM.Analytical.Results.IResult>, System.String, System.Collections.Generic.List<System.String>)
  • BH.Engine.Vision.Compute.DetectObjects(System.String, System.Boolean)
  • BH.Engine.Vision.Compute.DrawDetection(System.Drawing.Image, null, System.Double)

Ideally, those methods should be added directly to the Versioning_Toolkit\BHoMUpgrader40\Upgrades.json file to match the upgrader with the time the method was changed. This means a bit of manual work compared to the usual versioning attribute 😄 .

Thankfully, this is decently simple to do. The part of the dictionary where you need to add that info is Method.ToNew. The key is what I already provided above when listing the methods. The value is the json representation of the new method replacing it. You can obtain that with a simple script like this one:

image

Please tick the methods in the list that you are working on so everyone else knows they don't have to fix those.

@adecler
Copy link
Member Author

adecler commented Jan 22, 2021

Finally there are few items that I have already added to the two new categories but you will still need to add a custom message for the user. Here's the list:

Deleted items:

  • BH.oM.PerformanceDashboard.AccreditationBREEAM
  • BH.oM.PerformanceDashboard.AccreditationWELL
  • BH.oM.PerformanceDashboard.Address
  • BH.oM.PerformanceDashboard.EmbodiedCarbon
  • BH.oM.PerformanceDashboard.EnergyMeasured
  • BH.oM.PerformanceDashboard.EnergyModelled
  • BH.oM.PerformanceDashboard.Meter
  • BH.oM.PerformanceDashboard.NetZeroCarbon
  • BH.oM.PerformanceDashboard.Record
  • BH.oM.Adapters.DIALux.Furnishing
  • BH.oM.Adapters.DIALux.Luminaire
  • BH.oM.Adapters.DIALux.LuminaireType
  • BH.oM.Adapters.DIALux.Project
  • BH.oM.Adapters.DIALux.Room
  • BH.oM.Adapters.DIALux.StfFile
  • BH.oM.Adapters.DIALux.Structure
  • BH.oM.Adapters.DIALux.Version
  • BH.oM.MEP.Results.MEPSystemResults
  • BH.Engine.Adapters.Revit.Create.BHoMObject(System.Int32)
  • BH.Engine.Adapters.Revit.Create.BHoMObject(System.String)
  • BH.Engine.Adapters.Revit.Modify.SetFamilyLibrary(BH.oM.Adapters.Revit.Settings.FamilyLoadSettings, BH.oM.Adapters.Revit.FamilyLibrary)
  • BH.Engine.Adapters.Revit.Modify.SetFamilyLibrary(BH.oM.Adapters.Revit.Settings.RevitSettings, BH.oM.Adapters.Revit.FamilyLibrary)
  • BH.Engine.Adapters.Revit.Modify.SetFamilyName(BH.oM.Environment.Fragments.OriginContextFragment, System.String)
  • BH.Engine.Adapters.Revit.Modify.SetFamilyTypeName(BH.oM.Environment.Fragments.OriginContextFragment, System.String)
  • BH.Engine.Adapters.Revit.Modify.SetMapSettings(BH.oM.Adapters.Revit.Settings.RevitSettings, BH.oM.Adapters.Revit.Settings.ParameterSettings)
  • BH.Engine.Adapters.Revit.Modify.UpdateCustomDataValue(BH.oM.Base.IBHoMObject, System.String, System.Object)
  • BH.Engine.Adapters.Revit.Query.AdjacentSpaceId(BH.oM.Base.IBHoMObject)
  • BH.Engine.Adapters.Revit.Query.CustomDataValue(BH.oM.Base.IBHoMObject, System.String)
  • BH.Engine.Adapters.Revit.Query.Duplicate(BH.oM.Base.IBHoMObject)
  • BH.Engine.Adapters.Revit.Query.FamilyPlacementTypeName(BH.oM.Adapters.Revit.Elements.Family)
  • BH.Engine.Adapters.Revit.Query.FilterByType(System.Collections.Generic.IEnumerable<System.Object>, System.Type)
  • BH.Engine.Adapters.Revit.Query.IsAssignableFromByFullName(System.Type, System.Type)
  • BH.Engine.Adapters.Revit.Query.IsTemplate(BH.oM.Adapters.Revit.Elements.ViewPlan)
  • BH.Engine.Adapters.Revit.Query.IsZero(System.Double)
  • BH.Engine.Adapters.Revit.Query.Location(BH.oM.Adapters.Revit.Elements.ModelInstance)
  • BH.Engine.Adapters.Revit.Query.MapSettings(BH.oM.Adapters.Revit.Settings.RevitSettings)
  • BH.Engine.Adapters.Revit.Query.SheetNumber(BH.oM.Adapters.Revit.Elements.Viewport)
  • BH.Engine.Adapters.Revit.Query.SpaceId(BH.oM.Base.IBHoMObject)
  • BH.Engine.Adapters.Revit.Query.UniqueIds(System.Collections.Generic.IEnumerable<BH.oM.Base.IBHoMObject>, System.Boolean)
  • BH.Engine.Adapters.Revit.Query.ViewName(BH.oM.Adapters.Revit.Elements.Viewport)
  • BH.Engine.Adapters.Revit.Query.WorksetId(BH.oM.Base.IBHoMObject)

Items without automatic update:

  • BH.Engine.Adapters.Revit.Create.ViewPlan
  • BH.oM.Adapters.Revit.Generic.RevitFilePreview
  • BH.oM.LifeCycleAssessment.MaterialFragments.EnvironmentalProductDeclaration
  • BH.oM.LifeCycleAssessment.MaterialFragments.SectorEnvironmentalProductDeclaration
  • BH.oM.LifeCycleAssessment.MEPScope
  • BH.oM.LifeCycleAssessment.ProjectLifeCycleAssessment
  • BH.oM.LifeCycleAssessment.Results.GlobalWarmingPotentialResult
  • BH.oM.LifeCycleAssessment.Results.LifeCycleAssessmentResult
  • BH.oM.LifeCycleAssessment.StructuresScope
  • BH.oM.LifeCycleAssessment.TenantImprovementScope

Please add a message for those and tick the box when done

@adecler adecler added the status:WIP PR in progress and still in draft, not ready for formal review label Jan 22, 2021
BHoMUpgrader40/Upgrades.json Outdated Show resolved Hide resolved
@IsakNaslundBh
Copy link
Contributor

IsakNaslundBh commented Jan 25, 2021

On some of the structures ones

  • BH.Engine.Structure.Query.HasAssignedObjectIds(BH.oM.Structure.Loads.IElementLoad<BH.oM.Base.IBHoMObject>, System.String)
  • BH.Engine.Structure.Results.Query.MapResults(System.Collections.Generic.IEnumerable<BH.oM.Base.IBHoMObject>, System.Collections.Generic.IEnumerable<BH.oM.Analytical.Results.IResult>, BH.oM.Structure.Results.MapResultsBy, System.String, System.Collections.Generic.List<System.String>)
  • BH.Engine.Structure.Results.Query.MapResults(System.Collections.Generic.IEnumerable<BH.oM.Base.IBHoMObject>, System.Collections.Generic.IEnumerable<BH.oM.Analytical.Results.IResult>, System.String, System.Collections.Generic.List<System.String>)

They all had versioning applied, see: https://github.com/BHoM/BHoM_Engine/pull/2261/files#diff-42579e993975399d37e6a204d41643038c3b5e943eb36d690a268c094b0274f4 for example.

But assume they showing up here means it did not work for one or another reason? Can find the records for these methods in the Upgrades.json file for 4.0.

@adecler
Copy link
Member Author

adecler commented Jan 26, 2021

Congratulations @IsakNaslundBh !
You have the only 3 generic methods that have been versioned. The key for those is incorrectly generated by the VersionKey method: it doesn't replace the generic type by its contraint. I'll fix the Upgrades.json file manually and will then fix the method in the engine.

@IsakNaslundBh
Copy link
Contributor

Always good to be first! ... or is it..? 😄

@adecler
Copy link
Member Author

adecler commented Jan 27, 2021

All,

I feel it might be useful to provide a bit more context on the purpose of the messages provided in MessageForDeleted and MessageForNoUpgrade.

The idea behind the message is to

  • Provide enough information that the user can get their script working again
  • Explain why this method is not available anymore. If someone was using that component, it would make no sense whatsoever from their perspective why this would just be removed. So when there is no alternative solution to what they were using, it is good to provide as much context as possible to avoid frustration. Always offer the option to raise an issue on GitHub with link to the relevant repo (see one of the examples I already did).

To illustrate, here's a few messages that are not really helping the user:

“This method is obsolete and has been deleted from BHoM.”

-> Why ? How do I get the same functionality so my script can work again ?

“Mechanics of this method has changed causing the risk of changing the logic of the script. Please replace the component manually.”

-> What do I replace it with ? How do I match my old input with the new ones ? (remember it is complex enough that the upgrade couldn’t be automated)

@IsakNaslundBh
Copy link
Contributor

IsakNaslundBh commented Jan 27, 2021

Message for the BarVaryingDistributedLoad:
"The object has been redefined in such a way that automatic versioning is not possible. To reinstate the objects you could try exploding the CustomObject that will have been returned and make use of the BH.Enigne.Structure.Create.BarVaryingDistributedLoadDistanceBothEnds method from the Structures_Engine. If doing this, treat DistanceFromA as startToStartDistance and DistanceFromB as endToEndDistance. Also, treat ForceA and MomentA as ForceAtStart and MomentAtStart, and ForceB and MomentB as ForceAtEnd and MomentAtEnd. If you have any issues with the above, please feel free to raise an issue at https://github.com/BHoM/BHoM_Engine/issues."

@adecler
Copy link
Member Author

adecler commented Jan 27, 2021

I have handled most of the failing methods myself. Here's the ones that you guys will still have to take care of:

@pawelbaran : (plus missing messages)

BH.Engine.Adapters.Revit.Create.BuildingElement(System.Collections.Generic.IEnumerable<BH.oM.Geometry.Point>, BH.oM.Environment.Elements.PanelType, System.String)
BH.Engine.Adapters.Revit.Modify.SetFamilyLibrary(BH.oM.Adapters.Revit.Settings.FamilyLoadSettings, BH.oM.Adapters.Revit.FamilyLibrary)
BH.Engine.Adapters.Revit.Modify.SetFamilyLibrary(BH.oM.Adapters.Revit.Settings.RevitSettings, BH.oM.Adapters.Revit.FamilyLibrary)
BH.Engine.Adapters.Revit.Query.InnerPolyCurves(BH.oM.Geometry.PolyCurve, System.Collections.Generic.IEnumerable<BH.oM.Geometry.PolyCurve>)
BH.Engine.Adapters.Revit.Query.OuterPolyCurves(System.Collections.Generic.IEnumerable<BH.oM.Geometry.PolyCurve>)

@alelom :

BH.Engine.Diffing.Compute.DiffGenericObjects(System.Collections.Generic.IEnumerable<System.Object>, System.Collections.Generic.IEnumerable<System.Object>, null, System.Boolean)
BH.Engine.Diffing.Compute.Diffing(System.Collections.Generic.IEnumerable<System.Object>, System.Collections.Generic.IEnumerable<System.Object>, null, System.String)
BH.Engine.Diffing.Compute.DiffingHash(System.Object, null)
BH.Engine.Diffing.Compute.DiffOneByOne(System.Collections.Generic.IEnumerable<System.Object>, System.Collections.Generic.IEnumerable<System.Object>, null, System.Boolean)
BH.Engine.Diffing.Compute.DiffRevisions(BH.oM.Diffing.Revision, BH.oM.Diffing.Revision, null)
BH.Engine.Diffing.Compute.DiffWithCustomId(System.Collections.Generic.IEnumerable<BH.oM.Base.IBHoMObject>, System.Collections.Generic.IEnumerable<BH.oM.Base.IBHoMObject>, System.String, null)
BH.Engine.Diffing.Compute.DiffWithFragmentId(System.Collections.Generic.IEnumerable<BH.oM.Base.IBHoMObject>, System.Collections.Generic.IEnumerable<BH.oM.Base.IBHoMObject>, System.Type, System.String, null)
BH.Engine.Diffing.Create.DiffConfig(System.Boolean, System.Boolean)
BH.Engine.Diffing.Create.DiffConfig(System.Boolean, System.Boolean, System.Collections.Generic.List<System.String>, System.Collections.Generic.List<System.String>, System.Collections.Generic.List<System.String>)
BH.Engine.Diffing.Modify.PrepareForRevision(System.Collections.Generic.IEnumerable<BH.oM.Base.IBHoMObject>, null)
BH.Engine.Diffing.Modify.RemoveDuplicatesByHash(System.Collections.Generic.IEnumerable<BH.oM.Base.IBHoMObject>)
BH.Engine.Diffing.Modify.SetHashFragment(BH.oM.Base.IBHoMObject, null)
BH.Engine.Diffing.Modify.SetHashFragment(BH.oM.Base.IBHoMObject, System.String)
BH.Engine.Diffing.Modify.SetHashFragment(System.Collections.Generic.IEnumerable<BH.oM.Base.IBHoMObject>, null)
BH.Engine.Diffing.Query.AnyDuplicateByHash(System.Collections.Generic.IEnumerable<BH.oM.Base.IBHoMObject>)
BH.Engine.Diffing.Query.DifferentProperties(System.Object, System.Object, null)
BH.Engine.Diffing.Query.GetHashFragment(BH.oM.Base.IBHoMObject)

@FraserGreenroyd : (plus missing messages)

BH.Engine.Adapters.TAS.Create.BHoMObject(System.Int32)
BH.Engine.Adapters.TAS.Create.BuildingElement(System.Int32)
BH.Engine.Adapters.TAS.Modify.UpdateCustomDataValue(BH.oM.Base.IBHoMObject, System.String, System.Object)
BH.Engine.Adapters.TAS.Query.IsExternal(BH.oM.Environment.Elements.Panel)
BH.Engine.Adapters.TAS.Query.SurfaceType(BH.oM.Environment.Elements.Panel)
BH.Engine.BuildingEnvironment.Convert.ToConstruction(BH.oM.Base.CustomObject)
BH.Engine.BuildingEnvironment.Convert.ToGasMaterial(BH.oM.Base.CustomObject)
BH.Engine.BuildingEnvironment.Convert.ToLayer(BH.oM.Base.CustomObject)
BH.Engine.BuildingEnvironment.Convert.ToMaterial(BH.oM.Base.CustomObject)
BH.Engine.BuildingEnvironment.Convert.ToSolidMaterial(BH.oM.Base.CustomObject)
BH.Engine.ClimateEmergency.Compute.PlumbingFixtureWaterDemandPerDay(null, null, BH.oM.Base.CustomObject)
BH.Engine.ClimateEmergency.Create.BuildingOccupancyByGender(System.Int32, System.Double, System.Double, System.Double)
BH.Engine.ClimateEmergency.Create.BuildingPlumbingFixtureSelection(System.Double, System.Double, System.Double, System.Double, System.Double)
BH.Engine.Environment.Create.Layer(System.String, BH.oM.Physical.Materials.Material, System.Double)
BH.Engine.MEP.Query.EquipmentLengthByPart(System.Collections.Generic.List<BH.oM.Base.CustomObject>)
BH.Engine.PerformanceDashboard.Create.Space(System.String, BH.oM.Environment.Elements.SpaceType, System.Double)

@pawelbaran
Copy link
Member

Thank you @adecler for doing the majority of the job for us. Regarding the methods you mention:

  • BH.Engine.Adapters.Revit.Create.BuildingElement(System.Collections.Generic.IEnumerable<BH.oM.Geometry.Point>, BH.oM.Environment.Elements.PanelType, System.String) - as mentioned in this comment, this method does not exist since a very long time, so a generic deletion method should be fine.
  • BH.Engine.Adapters.Revit.Modify.SetFamilyLibrary(BH.oM.Adapters.Revit.Settings.FamilyLoadSettings, BH.oM.Adapters.Revit.FamilyLibrary) and BH.Engine.Adapters.Revit.Modify.SetFamilyLibrary(BH.oM.Adapters.Revit.Settings.RevitSettings, BH.oM.Adapters.Revit.FamilyLibrary) - This method has been deleted from BHoM as a duplicate of SetProperty and should be replaced with the latter, which provides similar mechanism.
  • BH.Engine.Adapters.Revit.Query.InnerPolyCurves(BH.oM.Geometry.PolyCurve, System.Collections.Generic.IEnumerable<BH.oM.Geometry.PolyCurve>) - This method has been deleted from BHoM due to bugs and lack of compliance. Please use BH.Engine.Geometry.Compute.DistributeOutlines and drop the first item from each output in order to achieve the similar behaviour.
  • BH.Engine.Adapters.Revit.Query.OuterPolyCurves(System.Collections.Generic.IEnumerable<BH.oM.Geometry.PolyCurve>) - This method has been deleted from BHoM due to bugs and lack of compliance. Please use BH.Engine.Geometry.Compute.DistributeOutlines and take the first item from each output in order to achieve the similar behaviour.

@alelom
Copy link
Member

alelom commented Jan 27, 2021

Break down of the upgrades/deleted/notUpgradable done in 05bc217 for the Diffing methods:

  • DELETED BH.Engine.Diffing.Compute.DiffGenericObjects(System.Collections.Generic.IEnumerable<System.Object>, System.Collections.Generic.IEnumerable<System.Object>, null, System.Boolean)
  • UPGRADED BH.Engine.Diffing.Compute.Diffing(System.Collections.Generic.IEnumerable<System.Object>, System.Collections.Generic.IEnumerable<System.Object>, null, System.String)
  • UPGRADED BH.Engine.Diffing.Compute.DiffingHash(System.Object, null)
  • UPGRADED BH.Engine.Diffing.Compute.DiffOneByOne(System.Collections.Generic.IEnumerable<System.Object>, System.Collections.Generic.IEnumerable<System.Object>, null, System.Boolean)
  • UPGRADED BH.Engine.Diffing.Compute.DiffRevisions(BH.oM.Diffing.Revision, BH.oM.Diffing.Revision, null)
  • UPGRADED BH.Engine.Diffing.Compute.DiffWithCustomId(System.Collections.Generic.IEnumerable<BH.oM.Base.IBHoMObject>, System.Collections.Generic.IEnumerable<BH.oM.Base.IBHoMObject>, System.String, null)
  • UPGRADED BH.Engine.Diffing.Compute.DiffWithFragmentId(System.Collections.Generic.IEnumerable<BH.oM.Base.IBHoMObject>, System.Collections.Generic.IEnumerable<BH.oM.Base.IBHoMObject>, System.Type, System.String, null)
  • UPGRADED BH.Engine.Diffing.Create.DiffConfig(System.Boolean, System.Boolean)
  • UPGRADED BH.Engine.Diffing.Create.DiffConfig(System.Boolean, System.Boolean, System.Collections.Generic.List<System.String>, System.Collections.Generic.List<System.String>, System.Collections.Generic.List<System.String>)
  • UPGRADED BH.Engine.Diffing.Modify.PrepareForRevision(System.Collections.Generic.IEnumerable<BH.oM.Base.IBHoMObject>, null)
  • UPGRADED BH.Engine.Diffing.Modify.RemoveDuplicatesByHash(System.Collections.Generic.IEnumerable<BH.oM.Base.IBHoMObject>)
  • NOT UPGRADABLE BH.Engine.Diffing.Modify.SetHashFragment(BH.oM.Base.IBHoMObject, null)
  • NOT UPGRADABLE BH.Engine.Diffing.Modify.SetHashFragment(BH.oM.Base.IBHoMObject, System.String)
  • NOT UPGRADABLE BH.Engine.Diffing.Modify.SetHashFragment(System.Collections.Generic.IEnumerable<BH.oM.Base.IBHoMObject>, null)
  • DELETED BH.Engine.Diffing.Query.AnyDuplicateByHash(System.Collections.Generic.IEnumerable<BH.oM.Base.IBHoMObject>)
  • UPGRADED BH.Engine.Diffing.Query.DifferentProperties(System.Object, System.Object, null)
  • DELETED BH.Engine.Diffing.Query.GetHashFragment(BH.oM.Base.IBHoMObject)

@FraserGreenroyd
Copy link
Contributor

All but one of mine in that latest list have been deleted, I'll get them sorted tomorrow hopefully.

@adecler
Copy link
Member Author

adecler commented Jan 28, 2021

Thanks @alelom , I have fixed the null parameters in the method keys as discussed so all is good on your side 👍

@adecler
Copy link
Member Author

adecler commented Jan 28, 2021

Thanks @pawelbaran , I have added the messages you provided. A few things to note:

  • The test dataset corresponds to all the methods and objects that can be found in beta 3.3. Create.BuildingElement will still need a message that provides a minimum of help to the user.
  • The following methods still need a message (see this comment):
BH.Engine.Adapters.Revit.Create.BHoMObject(System.Int32)
BH.Engine.Adapters.Revit.Create.BHoMObject(System.String)
BH.Engine.Adapters.Revit.Create.ViewPlan
BH.Engine.Adapters.Revit.Modify.SetFamilyName(BH.oM.Environment.Fragments.OriginContextFragment, System.String)
BH.Engine.Adapters.Revit.Modify.SetFamilyTypeName(BH.oM.Environment.Fragments.OriginContextFragment, System.String)
BH.Engine.Adapters.Revit.Modify.SetMapSettings(BH.oM.Adapters.Revit.Settings.RevitSettings, BH.oM.Adapters.Revit.Settings.ParameterSettings)
BH.Engine.Adapters.Revit.Modify.UpdateCustomDataValue(BH.oM.Base.IBHoMObject, System.String, System.Object)
BH.Engine.Adapters.Revit.Query.AdjacentSpaceId(BH.oM.Base.IBHoMObject)
BH.Engine.Adapters.Revit.Query.CustomDataValue(BH.oM.Base.IBHoMObject, System.String)
BH.Engine.Adapters.Revit.Query.Duplicate(BH.oM.Base.IBHoMObject)
BH.Engine.Adapters.Revit.Query.FamilyPlacementTypeName(BH.oM.Adapters.Revit.Elements.Family)
BH.Engine.Adapters.Revit.Query.FilterByType(System.Collections.Generic.IEnumerable<System.Object>, System.Type)
BH.Engine.Adapters.Revit.Query.IsAssignableFromByFullName(System.Type, System.Type)
BH.Engine.Adapters.Revit.Query.IsTemplate(BH.oM.Adapters.Revit.Elements.ViewPlan)
BH.Engine.Adapters.Revit.Query.IsZero(System.Double)
BH.Engine.Adapters.Revit.Query.Location(BH.oM.Adapters.Revit.Elements.ModelInstance)
BH.Engine.Adapters.Revit.Query.MapSettings(BH.oM.Adapters.Revit.Settings.RevitSettings)
BH.Engine.Adapters.Revit.Query.SheetNumber(BH.oM.Adapters.Revit.Elements.Viewport)
BH.Engine.Adapters.Revit.Query.SpaceId(BH.oM.Base.IBHoMObject)
BH.Engine.Adapters.Revit.Query.UniqueIds(System.Collections.Generic.IEnumerable<BH.oM.Base.IBHoMObject>, System.Boolean)
BH.Engine.Adapters.Revit.Query.ViewName(BH.oM.Adapters.Revit.Elements.Viewport)
BH.Engine.Adapters.Revit.Query.WorksetId(BH.oM.Base.IBHoMObject)
BH.oM.Adapters.Revit.Generic.RevitFilePreview

@adecler adecler force-pushed the Versioning_Toolkit-#117-MessageForItemWithoutUpdate branch from 1379c33 to ecb046b Compare January 29, 2021 02:17
@FraserGreenroyd
Copy link
Contributor

@adecler I have now managed to do the ones mentioned in this comment - I'll now go back to the top and look at what else I can provide messages for from the other lists.

@FraserGreenroyd
Copy link
Contributor

I will get the others done with @michaelhoehn later this afternoon (when he's awake) as it looks like everything from me is done (at long last!) 😄

@pawelbaran
Copy link
Member

@adecler I took another round through the methods, please see the list below.

"This method of applying ElementId to a BHoMObject is not valid any more. In order to extract the information about a given Revit element, please pull using FilterByElementIds request instead."
BH.Engine.Adapters.Revit.Create.BHoMObject(System.Int32)


"This method of applying ElementId to a BHoMObject is not valid any more. In order to extract the information about a given Revit element, please pull using FilterByUniqueIds request instead."
BH.Engine.Adapters.Revit.Create.BHoMObject(System.String)


"This method is not available any more. To reinstate the object, please use BH.Engine.Adapters.Revit.Create(string, string) instead."
BH.Engine.Adapters.Revit.Create.ViewPlan


"This method was a duplicate of SetProperty method, please use the latter instead."
BH.Engine.Adapters.Revit.Modify.SetFamilyName(BH.oM.Environment.Fragments.OriginContextFragment, System.String)
BH.Engine.Adapters.Revit.Modify.SetFamilyTypeName(BH.oM.Environment.Fragments.OriginContextFragment, System.String)
BH.Engine.Adapters.Revit.Modify.SetMapSettings(BH.oM.Adapters.Revit.Settings.RevitSettings, BH.oM.Adapters.Revit.Settings.ParameterSettings)
BH.Engine.Adapters.Revit.Modify.UpdateCustomDataValue(BH.oM.Base.IBHoMObject, System.String, System.Object)


"The information about adjacent space Id is not stored on this BHoM object any more, therefore the method became unusable."
BH.Engine.Adapters.Revit.Query.AdjacentSpaceId(BH.oM.Base.IBHoMObject)


"This method was a duplicate of GetProperty method, please use the latter instead."
BH.Engine.Adapters.Revit.Query.CustomDataValue(BH.oM.Base.IBHoMObject, System.String)
BH.Engine.Adapters.Revit.Query.Location(BH.oM.Adapters.Revit.Elements.ModelInstance)
BH.Engine.Adapters.Revit.Query.MapSettings(BH.oM.Adapters.Revit.Settings.RevitSettings)
BH.Engine.Adapters.Revit.Query.SheetNumber(BH.oM.Adapters.Revit.Elements.Viewport)
BH.Engine.Adapters.Revit.Query.ViewName(BH.oM.Adapters.Revit.Elements.Viewport)


"This method was a duplicate of RemoveIdentifiers method, please use the latter instead."
BH.Engine.Adapters.Revit.Query.Duplicate(BH.oM.Base.IBHoMObject)


"The information about family placement type is not stored on this BHoM object any more, therefore the method became unusable."
BH.Engine.Adapters.Revit.Query.FamilyPlacementTypeName(BH.oM.Adapters.Revit.Elements.Family)


"This method was a duplicate of BH.Engine.Base.Query.FilterByType method, please use the latter instead."
BH.Engine.Adapters.Revit.Query.FilterByType(System.Collections.Generic.IEnumerable<System.Object>, System.Type)


"This method has been deleted as similar results can be achieved by using standard .NET Type.IsAssignableFrom query. Please use the latter instead."
BH.Engine.Adapters.Revit.Query.IsAssignableFromByFullName(System.Type, System.Type)


"This method has been removed as the object definition of ViewPlan has changed. In order to check if an object represents a template, check its TemplateName property using GetProperty - if it is not empty or null, the object represents a template."
BH.Engine.Adapters.Revit.Query.IsTemplate(BH.oM.Adapters.Revit.Elements.ViewPlan)


"This method has been deleted as it could yield wrong results in case of non-default settings. In order to check if the number is close enough to zero, simply check if its absolute value is smaller than the assumed tolerance (default for BHoM is 1e-6).
BH.Engine.Adapters.Revit.Query.IsZero(System.Double)


"The information about space Id is not stored on this BHoM object any more, therefore the method became unusable. If the queried object is a space, query its Id using BH.Engine.Adapters.Revit.Query.ElementId method."
BH.Engine.Adapters.Revit.Query.SpaceId(BH.oM.Base.IBHoMObject)


"This method has been deleted from BHoM. In order to reproduce its behaviour, filter nulls manually if needed, and then run BH.Engine.Adapters.Revit.Query.UniqueId method."
BH.Engine.Adapters.Revit.Query.UniqueIds(System.Collections.Generic.IEnumerable<BH.oM.Base.IBHoMObject>, System.Boolean)


"This method has been deleted from BHoM. There is no replacement available for it at the moment, but it is meant to be provided soon."
BH.Engine.Adapters.Revit.Query.WorksetId(BH.oM.Base.IBHoMObject)


"The object has been redefined in such a way that automatic versioning is not possible. To reinstate the object, please use BH.Engine.Adapters.Revit.Create.RevitFilePreview method."
BH.oM.Adapters.Revit.Generic.RevitFilePreview


It is hard for me to speak for Create.BuildingElement as this method had disappeared before I even started working on Revit and I do not even know when and how was it possible to use it - any generic message will be a good message.

@adecler
Copy link
Member Author

adecler commented Jan 30, 2021

Thanks everyone, this PR is now ready for merging in my opinion.

I have created a slightly less cluttered version of the test script here if you are interested.

Note that some items still don't version correctly but issues have been raised for them:

BHoM/BHoM#1158
https://github.com/BHoM/BHoM/issues/1159
https://github.com/BuroHappoldEngineering/Radiance_Toolkit/issues/256
BHoM/LifeCycleAssessment_Toolkit#200

@adecler
Copy link
Member Author

adecler commented Feb 2, 2021

@BHoMBot check copyright

@bhombot-ci
Copy link

bhombot-ci bot commented Feb 2, 2021

@adecler to confirm, check-copyright-compliance task is now queued.

@adecler
Copy link
Member Author

adecler commented Feb 2, 2021

@BHoMBot check copyright

@bhombot-ci
Copy link

bhombot-ci bot commented Feb 2, 2021

@adecler to confirm, check-copyright-compliance task is now queued.

@adecler
Copy link
Member Author

adecler commented Feb 2, 2021

@BHoMBot check installer

@bhombot-ci
Copy link

bhombot-ci bot commented Feb 2, 2021

@adecler to confirm, check-installer task is now queued.

@adecler
Copy link
Member Author

adecler commented Feb 2, 2021

@FraserGreenroyd , @enarhi , it seems that the recent change to BH.oM.Inspection.Audit, prevent the iAuditor_Toolkit to compile. So that should probably be fixed as a priority.

@FraserGreenroyd ,Not sure how Azure was happy with the installer check at the time that PR was merged but not now.

@adecler
Copy link
Member Author

adecler commented Feb 2, 2021

@BHoMBot check installer

1 similar comment
@adecler
Copy link
Member Author

adecler commented Feb 2, 2021

@BHoMBot check installer

@bhombot-ci
Copy link

bhombot-ci bot commented Feb 2, 2021

@adecler just to let you know, I have provided a check-installer result to this Pull Request as it was detected to be linked to other Pull Requests in a series. The comment which triggered this check came from @adecler on BHoM_Engine

Copy link
Member

@alelom alelom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving, based on the test files (I tested using both the first one and this) and on the comment that points to the remaining issues (already raised).

@adecler adecler merged commit 2fb2a5d into master Feb 3, 2021
@adecler adecler deleted the Versioning_Toolkit-#117-MessageForItemWithoutUpdate branch February 3, 2021 01:32
@alelom alelom restored the Versioning_Toolkit-#117-MessageForItemWithoutUpdate branch May 14, 2021 11:16
@FraserGreenroyd FraserGreenroyd deleted the Versioning_Toolkit-#117-MessageForItemWithoutUpdate branch September 27, 2021 10:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:WIP PR in progress and still in draft, not ready for formal review type:compliance Non-conforming to code guidelines type:feature New capability or enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Provide a bespoke message to the user for each method and object that was deleted without replacement
5 participants