Skip to content

BHoM_Adapter: Issue with some deep dependency types #339

Closed
@IsakNaslundBh

Description

@IsakNaslundBh

Description:

The dependency order management does not function as intended for some cases.

When for example, pushing a BarUniformlyDistributedLoad without at the same time pushing bars, the dependency sorting makes it so that the bars are pushed as the second item, before Nodes and sections etc.

Steps to reproduce:

A test method like:

        [Test]
        public void DependencyOrder_CreateLoadNoObjectsWithIds()
        {
            List<BarUniformlyDistributedLoad> loads = Create.RandomObjects<BarUniformlyDistributedLoad>(3);

            sa.Push(loads);

            string correctOrder = "BH.oM.Structure.Constraints.Constraint6DOF, BH.oM.Structure.MaterialFragments.IMaterialFragment, BH.oM.Structure.SectionProperties.ISectionProperty, BH.oM.Structure.Elements.Node, BH.oM.Structure.Constraints.BarRelease, BH.oM.Structure.Offsets.Offset, BH.oM.Structure.Elements.Bar, BH.oM.Structure.Loads.BarUniformlyDistributedLoad";
            string createdOrder = string.Join(", ", sa.Created.Select(c => c.Item1.FullName));

            Assert.AreEqual(correctOrder, createdOrder);
        }

Will highlight the problem

Expected behaviour:

For recursive evaluation of dependencies to function, independent on if other objects are pushed simultaneously or not. Order of objects being put in to the push component also should not matter.

Test file(s):

See test method above

Metadata

Metadata

Labels

severity:criticalNo workaround exists. Essential to continuetype:bugError or unexpected behaviour

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions