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

GSAGH-497 - GsaGH creates releases opposite to what is defined using 'Edit element/member' component #721

Open
wants to merge 15 commits into
base: main
Choose a base branch
from

Conversation

SandeepArup
Copy link
Collaborator

No description provided.

Copy link
Collaborator

Choose a reason for hiding this comment

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

why we need this update?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Update is required as opening file will have info of GsaBool6Parameter but that does not know how to parse "FFFRRR" as those cast has been removed from GsaBool6Parameter.

Comment on lines 91 to 92
} else if (mystring == "release" || mystring == "released" || mystring == "hinge"
|| mystring == "hinged" || mystring == "charnier") {
Copy link
Collaborator

Choose a reason for hiding this comment

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

wrap with a method or two. IsHinged(), IsReleased()

Comment on lines 111 to 124
if (FindString(booleanString, "x☐") || FindString(booleanString, "x✓")
|| FindString(booleanString, "y☐") || FindString(booleanString, "y✓")
|| FindString(booleanString, "z☐") || FindString(booleanString, "z✓")
|| FindString(booleanString, "xx☐") || FindString(booleanString, "xx✓")
|| FindString(booleanString, "yy☐") || FindString(booleanString, "yy✓")
|| FindString(booleanString, "zz☐") || FindString(booleanString, "zz✓")) {

input.X = FindString(booleanString, "x✓");
input.Y = FindString(booleanString, "y✓");
input.Z = FindString(booleanString, "z✓");
input.Xx = FindString(booleanString, "xx✓");
input.Yy = FindString(booleanString, "yy✓");
input.Zz = FindString(booleanString, "zz✓");
return true;
Copy link
Collaborator

Choose a reason for hiding this comment

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

hmm why do we check this? Can we not check the True / False values instead?

GsaGH/Helpers/StringExtension.cs Show resolved Hide resolved
Copy link
Collaborator

Choose a reason for hiding this comment

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

Did we not said to create a common ancestor for GsaReleaseParameter and GsaRestrainParameter?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@SandeepArup SandeepArup marked this pull request as ready for review November 7, 2024 05:36
@SandeepArup
Copy link
Collaborator Author

CI

@@ -36,5 +38,63 @@ public static string UnsupportedValue(GH_ObjectWrapper ghTypeWrapper) {
type = type.Replace("Goo", string.Empty);
return type;
}

public static void UpdateReleaseBool6Parameter(this GH_ComponentParamServer parameters) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

why not 2 methods? one for input and one for output

}
}

public static void UpdateRestrainedBool6Parameter(this GH_ComponentParamServer parameters) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

as above

@@ -83,5 +88,67 @@ public void DuplicateTest(bool x, bool y, bool z, bool xx, bool yy, bool zz) {
Assert.Equal(yy, original.Yy);
Assert.Equal(zz, original.Zz);
}

[Fact]
public void ReleaseParameterInfoIsCorrect() {
Copy link
Collaborator

Choose a reason for hiding this comment

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

split to include one assert per test


//restraint is the opposite of release
output = StringExtension.ParseRestrain(text);
Assert.Equal(!releaseBool6, output);
Copy link
Collaborator

Choose a reason for hiding this comment

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

as above

@@ -30,6 +30,17 @@ public static GH_OasysComponent ComponentMother() {
return comp;
}

internal static void CompareRelease(GsaBool6 input, GsaBool6 output) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

as above

@@ -83,5 +88,67 @@ public void DuplicateTest(bool x, bool y, bool z, bool xx, bool yy, bool zz) {
Assert.Equal(yy, original.Yy);
Assert.Equal(zz, original.Zz);
}

[Fact]
public void ReleaseParameterInfoIsCorrect() {
Copy link
Collaborator

Choose a reason for hiding this comment

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

one assert per test

internal static void CompareRelease(GsaBool6 input, GsaBool6 output) {
Assert.Equal(input.ToString(), output.ToString());
Assert.Equal(input.ToString(), output.ToString());
Assert.Equal(input.X, output.X);
Copy link
Collaborator

Choose a reason for hiding this comment

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

as above

@@ -59,7 +59,7 @@ public override bool Read(GH_IReader reader) {
Params.ReplaceInputParameter(new GsaSpringPropertyParameter(), 7, true);
Params.ReplaceOutputParameter(new GsaSpringPropertyParameter(), 7);
}

Params.UpdateRestrainedBool6Parameter();
Copy link
Collaborator

Choose a reason for hiding this comment

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

is this for upgrading existing components with Bool6Params?

Copy link

codecov bot commented Nov 15, 2024

Codecov Report

Attention: Patch coverage is 98.00000% with 4 lines in your changes missing coverage. Please review.

Project coverage is 90.2%. Comparing base (83764a7) to head (5aec6be).

Files with missing lines Patch % Lines
GsaGH/Helpers/StringExtension.cs 97.2% 1 Missing and 1 partial ⚠️
GsaGH/Parameters/1_Properties/GsaBool6.cs 90.9% 0 Missing and 2 partials ⚠️
Additional details and impacted files

Impacted file tree graph

@@          Coverage Diff           @@
##            main    #721    +/-   ##
======================================
  Coverage   90.1%   90.2%            
======================================
  Files        520     522     +2     
  Lines      39296   39408   +112     
  Branches    4902    4914    +12     
======================================
+ Hits       35441   35553   +112     
+ Misses      2582    2580     -2     
- Partials    1273    1275     +2     
Files with missing lines Coverage Δ
GsaGH/Components/2_Geometry/CreateSupport.cs 98.7% <100.0%> (+<0.1%) ⬆️
GsaGH/Components/2_Geometry/Edit1dElement.cs 96.4% <100.0%> (+<0.1%) ⬆️
GsaGH/Components/2_Geometry/Edit1dMember.cs 94.9% <100.0%> (+<0.1%) ⬆️
GsaGH/Components/2_Geometry/EditNode.cs 87.4% <100.0%> (+<0.1%) ⬆️
GsaGH/Helpers/GH/ReplaceParam.cs 100.0% <100.0%> (ø)
GsaGH/Parameters/1_Properties/GsaBool6Parameter.cs 85.0% <ø> (-8.1%) ⬇️
...aGH/Parameters/1_Properties/GsaReleaseParameter.cs 100.0% <100.0%> (ø)
.../Parameters/1_Properties/GsaRestrainedParameter.cs 100.0% <100.0%> (ø)
GsaGH/Properties/Resources.Designer.cs 90.6% <100.0%> (+<0.1%) ⬆️
GsaGH/Helpers/StringExtension.cs 97.6% <97.2%> (-2.4%) ⬇️
... and 1 more

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

Successfully merging this pull request may close these issues.

3 participants