Uploaded image for project: 'GMAT'
  1. GMAT
  2. GMT-3341

Behavior of empty reference arrays is inconsistent

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: P1
    • Resolution: Duplicate
    • Affects Version/s: None
    • Fix Version/s: None
    • Labels:
      None
    • Environment:

      Windows 7 Enterprise 64-bit
      2012-11-28 build

      Description

      The syntax "field = {}" behaves differently for each resource:

      • Barycenter.BodyNames: resets to default
      • ForceModel.PointMasses: nothing
      • ForceModel.PrimaryBodies: resets to default
      • Formation.Add: not allowed
      • GroundTrackPlot.Add: empties list
      • ImpulsiveBurn.Tank: not allowed
      • ReportFile.Add: not allowed
      • Spacecraft.Tanks: not allowed
      • Spacecraft.Thrusters: not allowed
      • Thruster.Tank: not allowed
      • XYPlot.YVariables: not allowed

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

              jjkparker Joel Parker created issue -
              jjkparker Joel Parker made changes -
              Field Original Value New Value
              Description The behavior of setting arrays of resource and parameter references is inconsistent from resource to resource.

              *Issue 1*:
              The syntax "ForceModel.PointMasses = {Mars, Sun}" _adds_ Mars and Sun to the point masses list. With all other fields of this type, it _replaces_ the contents. There is no way to remove a value from PointMasses through the script.

              *Issue 2*:
              The syntax "field = {}" behaves differently for each resource:
              * {{_Barycenter_.BodyNames}}: resets to default
              * {{_ForceModel_.PointMasses}}: nothing
              * {{_ForceModel_.PrimaryBodies}}: resets to default
              * {{_Formation_.Add}}: not allowed
              * {{_GroundTrackPlot_.Add}}: empties list
              * {{_ImpulsiveBurn_.Tank}}: not allowed
              * {{_ReportFile_.Add}}: not allowed
              * {{_Spacecraft_.Tanks}}: not allowed
              * {{_Spacecraft_.Thrusters}}: not allowed
              * {{_Thruster_.Tank}}: not allowed
              * {{_XYPlot_.YVariables}}: not allowed

              *Issue 3*:
              The syntax:
              {noformat}
              field = {'value1' 'value2'} % notice quotes
              {noformat}
              is inconsistently handled:
              * works: {{Barycenter.BodyNames}}, {{GroundTrackPlot.Add}}, all fields in Mission Sequence
              * fails: {{Formation.Add}}, {{ImpulsiveBurn.Tank}}, {{ReportFile.Add}}, {{Spacecraft.Tanks}}, {{Spacecraft.Thrusters}}, {{XYPlot.YVariables}}
              The behavior of setting arrays of resource and parameter references is inconsistent from resource to resource.

              *Issue 1*:
              The syntax "ForceModel.PointMasses = {Mars, Sun}" _adds_ Mars and Sun to the point masses list. With all other fields of this type, it _replaces_ the contents. There is no way to remove a value from PointMasses through the script.

              *Issue 2*:
              The syntax "field = {}" behaves differently for each resource:
              * {{_Barycenter_.BodyNames}}: resets to default
              * {{_ForceModel_.PointMasses}}: nothing
              * {{_ForceModel_.PrimaryBodies}}: resets to default
              * {{_Formation_.Add}}: not allowed
              * {{_GroundTrackPlot_.Add}}: empties list
              * {{_ImpulsiveBurn_.Tank}}: not allowed
              * {{_ReportFile_.Add}}: not allowed
              * {{_Spacecraft_.Tanks}}: not allowed
              * {{_Spacecraft_.Thrusters}}: not allowed
              * {{_Thruster_.Tank}}: not allowed
              * {{_XYPlot_.YVariables}}: not allowed

              *Issue 3*:
              The syntax:
              {noformat}
              field = {'value1' 'value2'} % notice quotes
              {noformat}
              is inconsistently handled:
              * works: {{Barycenter.BodyNames}}, {{ForceModel.PrimaryBodies}}, {{GroundTrackPlot.Add}}, all fields in Mission Sequence
              * fails: {{ForceModel.PointMasses}}, {{Formation.Add}}, {{ImpulsiveBurn.Tank}}, {{ReportFile.Add}}, {{Spacecraft.Tanks}}, {{Spacecraft.Thrusters}}, {{XYPlot.YVariables}}
              jjkparker Joel Parker made changes -
              Description The behavior of setting arrays of resource and parameter references is inconsistent from resource to resource.

              *Issue 1*:
              The syntax "ForceModel.PointMasses = {Mars, Sun}" _adds_ Mars and Sun to the point masses list. With all other fields of this type, it _replaces_ the contents. There is no way to remove a value from PointMasses through the script.

              *Issue 2*:
              The syntax "field = {}" behaves differently for each resource:
              * {{_Barycenter_.BodyNames}}: resets to default
              * {{_ForceModel_.PointMasses}}: nothing
              * {{_ForceModel_.PrimaryBodies}}: resets to default
              * {{_Formation_.Add}}: not allowed
              * {{_GroundTrackPlot_.Add}}: empties list
              * {{_ImpulsiveBurn_.Tank}}: not allowed
              * {{_ReportFile_.Add}}: not allowed
              * {{_Spacecraft_.Tanks}}: not allowed
              * {{_Spacecraft_.Thrusters}}: not allowed
              * {{_Thruster_.Tank}}: not allowed
              * {{_XYPlot_.YVariables}}: not allowed

              *Issue 3*:
              The syntax:
              {noformat}
              field = {'value1' 'value2'} % notice quotes
              {noformat}
              is inconsistently handled:
              * works: {{Barycenter.BodyNames}}, {{ForceModel.PrimaryBodies}}, {{GroundTrackPlot.Add}}, all fields in Mission Sequence
              * fails: {{ForceModel.PointMasses}}, {{Formation.Add}}, {{ImpulsiveBurn.Tank}}, {{ReportFile.Add}}, {{Spacecraft.Tanks}}, {{Spacecraft.Thrusters}}, {{XYPlot.YVariables}}
              The behavior of setting arrays of resource and parameter references is inconsistent from resource to resource.

              *Issue 1*:
              The syntax "ForceModel.PointMasses = {Mars, Sun}" _adds_ Mars and Sun to the point masses list. With all other fields of this type, it _replaces_ the contents. There is no way to remove a value from PointMasses through the script.

              *Issue 2*:
              The syntax "field = {}" behaves differently for each resource:
              * {{_Barycenter_.BodyNames}}: resets to default
              * {{_ForceModel_.PointMasses}}: nothing
              * {{_ForceModel_.PrimaryBodies}}: resets to default
              * {{_Formation_.Add}}: not allowed
              * {{_GroundTrackPlot_.Add}}: empties list
              * {{_ImpulsiveBurn_.Tank}}: not allowed
              * {{_ReportFile_.Add}}: not allowed
              * {{_Spacecraft_.Tanks}}: not allowed
              * {{_Spacecraft_.Thrusters}}: not allowed
              * {{_Thruster_.Tank}}: not allowed
              * {{_XYPlot_.YVariables}}: not allowed

              *Issue 3*:
              The syntax:
              {noformat}
              field = {'value1' 'value2'} % notice quotes
              {noformat}
              is inconsistently handled:
              * works: {{Barycenter.BodyNames}}, {{ForceModel.PrimaryBodies}}, {{GroundTrackPlot.Add}}
              * fails: {{ForceModel.PointMasses}}, {{Formation.Add}}, {{ImpulsiveBurn.Tank}}, {{ReportFile.Add}}, {{Spacecraft.Tanks}}, {{Spacecraft.Thrusters}}, {{XYPlot.YVariables}}
              * all fields succeed when set in the Mission Sequence (except {{ForceModel}})
              shughes Steven Hughes made changes -
              Description The behavior of setting arrays of resource and parameter references is inconsistent from resource to resource.

              *Issue 1*:
              The syntax "ForceModel.PointMasses = {Mars, Sun}" _adds_ Mars and Sun to the point masses list. With all other fields of this type, it _replaces_ the contents. There is no way to remove a value from PointMasses through the script.

              *Issue 2*:
              The syntax "field = {}" behaves differently for each resource:
              * {{_Barycenter_.BodyNames}}: resets to default
              * {{_ForceModel_.PointMasses}}: nothing
              * {{_ForceModel_.PrimaryBodies}}: resets to default
              * {{_Formation_.Add}}: not allowed
              * {{_GroundTrackPlot_.Add}}: empties list
              * {{_ImpulsiveBurn_.Tank}}: not allowed
              * {{_ReportFile_.Add}}: not allowed
              * {{_Spacecraft_.Tanks}}: not allowed
              * {{_Spacecraft_.Thrusters}}: not allowed
              * {{_Thruster_.Tank}}: not allowed
              * {{_XYPlot_.YVariables}}: not allowed

              *Issue 3*:
              The syntax:
              {noformat}
              field = {'value1' 'value2'} % notice quotes
              {noformat}
              is inconsistently handled:
              * works: {{Barycenter.BodyNames}}, {{ForceModel.PrimaryBodies}}, {{GroundTrackPlot.Add}}
              * fails: {{ForceModel.PointMasses}}, {{Formation.Add}}, {{ImpulsiveBurn.Tank}}, {{ReportFile.Add}}, {{Spacecraft.Tanks}}, {{Spacecraft.Thrusters}}, {{XYPlot.YVariables}}
              * all fields succeed when set in the Mission Sequence (except {{ForceModel}})



              The syntax "field = {}" behaves differently for each resource:
              * {{_Barycenter_.BodyNames}}: resets to default
              * {{_ForceModel_.PointMasses}}: nothing
              * {{_ForceModel_.PrimaryBodies}}: resets to default
              * {{_Formation_.Add}}: not allowed
              * {{_GroundTrackPlot_.Add}}: empties list
              * {{_ImpulsiveBurn_.Tank}}: not allowed
              * {{_ReportFile_.Add}}: not allowed
              * {{_Spacecraft_.Tanks}}: not allowed
              * {{_Spacecraft_.Thrusters}}: not allowed
              * {{_Thruster_.Tank}}: not allowed
              * {{_XYPlot_.YVariables}}: not allowed

              *Issue 3*:
              The syntax:
              {noformat}
              field = {'value1' 'value2'} % notice quotes
              {noformat}
              is inconsistently handled:
              * works: {{Barycenter.BodyNames}}, {{ForceModel.PrimaryBodies}}, {{GroundTrackPlot.Add}}
              * fails: {{ForceModel.PointMasses}}, {{Formation.Add}}, {{ImpulsiveBurn.Tank}}, {{ReportFile.Add}}, {{Spacecraft.Tanks}}, {{Spacecraft.Thrusters}}, {{XYPlot.YVariables}}
              * all fields succeed when set in the Mission Sequence (except {{ForceModel}})
              shughes Steven Hughes made changes -
              Summary Behavior of reference arrays is inconsistent Behavior of empty reference arrays is inconsistent
              shughes Steven Hughes made changes -
              Description


              The syntax "field = {}" behaves differently for each resource:
              * {{_Barycenter_.BodyNames}}: resets to default
              * {{_ForceModel_.PointMasses}}: nothing
              * {{_ForceModel_.PrimaryBodies}}: resets to default
              * {{_Formation_.Add}}: not allowed
              * {{_GroundTrackPlot_.Add}}: empties list
              * {{_ImpulsiveBurn_.Tank}}: not allowed
              * {{_ReportFile_.Add}}: not allowed
              * {{_Spacecraft_.Tanks}}: not allowed
              * {{_Spacecraft_.Thrusters}}: not allowed
              * {{_Thruster_.Tank}}: not allowed
              * {{_XYPlot_.YVariables}}: not allowed

              *Issue 3*:
              The syntax:
              {noformat}
              field = {'value1' 'value2'} % notice quotes
              {noformat}
              is inconsistently handled:
              * works: {{Barycenter.BodyNames}}, {{ForceModel.PrimaryBodies}}, {{GroundTrackPlot.Add}}
              * fails: {{ForceModel.PointMasses}}, {{Formation.Add}}, {{ImpulsiveBurn.Tank}}, {{ReportFile.Add}}, {{Spacecraft.Tanks}}, {{Spacecraft.Thrusters}}, {{XYPlot.YVariables}}
              * all fields succeed when set in the Mission Sequence (except {{ForceModel}})

              The syntax "field = {}" behaves differently for each resource:
              * {{_Barycenter_.BodyNames}}: resets to default
              * {{_ForceModel_.PointMasses}}: nothing
              * {{_ForceModel_.PrimaryBodies}}: resets to default
              * {{_Formation_.Add}}: not allowed
              * {{_GroundTrackPlot_.Add}}: empties list
              * {{_ImpulsiveBurn_.Tank}}: not allowed
              * {{_ReportFile_.Add}}: not allowed
              * {{_Spacecraft_.Tanks}}: not allowed
              * {{_Spacecraft_.Thrusters}}: not allowed
              * {{_Thruster_.Tank}}: not allowed
              * {{_XYPlot_.YVariables}}: not allowed

              shughes Steven Hughes made changes -
              Assignee Linda Jun [ gmatloj ] Joel Parker [ jjkparker ]
              Hide
              shughes Steven Hughes added a comment -

              CCB: P1 R2013a.

              + We need a policy describing what should happen. If across the board consistency is most important we should disallow in all cases. It may be better to have some simple rules depending upon whether or not an empty list is allowed. For example, an empty array on Barycenter should not mean that it has no bodies which leads to an undefined barycenter (same with libaration point). In other cases an empty list is acceptable (Thrusters for example).

              Once behavior is described, CCB will retriage.

              Show
              shughes Steven Hughes added a comment - CCB: P1 R2013a. + We need a policy describing what should happen. If across the board consistency is most important we should disallow in all cases. It may be better to have some simple rules depending upon whether or not an empty list is allowed. For example, an empty array on Barycenter should not mean that it has no bodies which leads to an undefined barycenter (same with libaration point). In other cases an empty list is acceptable (Thrusters for example). Once behavior is described, CCB will retriage.
              shughes Steven Hughes made changes -
              Fix Version/s R2013a [ 10201 ]
              Hide
              jjkparker Joel Parker added a comment -

              Proposal for R2013a:

              • Document in Script Language: "The behavior when specifying an empty list is resource-dependent."
              • Document on each resource.

              Proposal for Someday:

              • Empty list should mean "make the list contain nothing".
              • If the field cannot accept an empty list, throw an invalid input exception.

              This is consistent with other languages that accept object lists. We should see how close we can get to this behavior without causing huge backward-compatibility problems.

              Show
              jjkparker Joel Parker added a comment - Proposal for R2013a: Document in Script Language: "The behavior when specifying an empty list is resource-dependent." Document on each resource. Proposal for Someday: Empty list should mean "make the list contain nothing". If the field cannot accept an empty list, throw an invalid input exception. This is consistent with other languages that accept object lists. We should see how close we can get to this behavior without causing huge backward-compatibility problems.
              jjkparker Joel Parker made changes -
              Fix Version/s R2013a [ 10201 ]
              jjkparker Joel Parker made changes -
              Link This issue duplicates GMT-2528 [ GMT-2528 ]
              jjkparker Joel Parker made changes -
              Resolution Duplicate [ 3 ]
              Status Open [ 1 ] Resolved [ 5 ]
              jjkparker Joel Parker made changes -
              Status Resolved [ 5 ] Closed [ 6 ]

                People

                • Votes:
                  0 Vote for this issue
                  Watchers:
                  2 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: