-
Notifications
You must be signed in to change notification settings - Fork 26
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
Making Glassbr compatible with Strict Data #3818
Conversation
Is there a specific reason this was the approach taken? |
I argee I think it looks better when inlined. I changed it to a QuantityDict since making it a ConstrainedChunk adds unnecessary information. nomThick = cuc "nomThick"
(nounPhraseSent $ S "nominal thickness" +:+ displayDblConstrntsAsSet
`(mkQuant "nomThick" (nounPhraseSent $ S "nominal thickness") lT Rational Nothing Nothing)` nominalThicknesses)
lT millimetre {-Discrete nominalThicknesses, but not implemented-} Rational
[{- TODO: add back constraint: enumc nominalThicknesses -}] $ exactDbl 8 |
@@ -106,7 +106,7 @@ standOffDist = uq (constrained' (uc sD (variable "SD") Real metre) | |||
|
|||
nomThick = cuc "nomThick" | |||
(nounPhraseSent $ S "nominal thickness" +:+ displayDblConstrntsAsSet | |||
nomThick nominalThicknesses) | |||
(mkQuant "nomThick" (nounPhraseSent $ S "nominal thickness") lT Rational Nothing Nothing) nominalThicknesses) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seeing this added here, I would imagine it should be removed from somewhere else, no? Does this result in code duplication?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure what you are referring to, could you be more specific?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the underlying question is "is this information written anywhere else in our code base"?
A similar thought I had: the duplication of S "nominal thickness"
and the use of the Nothing
s seems to suggest that this chunk could be built with a different constructor than cuc
that builds it more "logically", but I'm not sure what other constructors are available.…
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What I mean by this is that we are duplicating the arguments "nomThick"
, nounPhraseSent $ S "nominal thickness" +:+ x
, lT
, and Rational
, which seems redundant. Are these defined anywhere else in the code that we could borrow from instead of redefining it (there may not be)? Looking at the constructors for ConstrainedChunk
, it looks like they all require some "base" "chunk" to build off of (which is one argument for moving away from our "nested" infrastructure), so we might be stuck using cuc
.
While investigating this, I noticed that the reason we have this "circular definition" is because we seem to be attempting to define it in terms of itself, instead of just actually giving it a definition, which prompted a potential agenda item for our next meeting. 👀
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree that this "smells bad". Feels like the wrong constructor is being used.
@@ -106,7 +106,7 @@ standOffDist = uq (constrained' (uc sD (variable "SD") Real metre) | |||
|
|||
nomThick = cuc "nomThick" | |||
(nounPhraseSent $ S "nominal thickness" +:+ displayDblConstrntsAsSet | |||
nomThick nominalThicknesses) | |||
(mkQuant "nomThick" (nounPhraseSent $ S "nominal thickness") lT Rational Nothing Nothing) nominalThicknesses) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree that this "smells bad". Feels like the wrong constructor is being used.
@NoahCardoso and I had a discussion just before 5pm on Friday, so the discussion didn't hit here yet, but we're going to look into removing the problematic part of the description entirely. Right now, the description of "t / nominal thickness" is "nominal thickness t \in {....}", which carries information about a constraint (i.e., #2655). So, it looks like we need to...
Then, we end up completely avoiding the issue by removing it's need for existence (i.e., ~ remembering to add in a feature). |
Closing in favour of (new) work towards #2655. |
In
glassbr.unitals
the ConstrainedChunknomThick
is self-referential creating an infinite loop when used with strict data. To prevent this, I created a new function callednomThick'
that gives thedisplayDblConstrntsAsSet
function innomThick
the information it needs to properly display the nominal thickness constraints as a set.