-
Notifications
You must be signed in to change notification settings - Fork 28
Fill chunk refs #4434
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
base: main
Are you sure you want to change the base?
Fill chunk refs #4434
Changes from all commits
d3c5451
f930e6b
32f3c04
e9e0038
d28cafb
5719827
8875f1f
631eec3
fd37057
3cd0f38
b926a6a
fdd1c54
517ff62
97212b7
a56504d
f9eda18
9db8448
288381d
5ba7073
21e5fde
65cc135
d82f5c4
ea3a593
2d418fa
30a1152
9840d37
a3891b4
b860ab6
c2ce1aa
b4dea08
7128107
2330c83
f2186c5
7d410dc
40a86f6
ec610c9
e70066f
b8a2991
1b11b06
3028ab6
e3b3de0
647c79b
84e07b2
5e39b6b
2b0c445
f59b91a
4068616
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -261,8 +261,13 @@ insertAllOutOfOrder12 strtr as bs cs ds es fs gs hs is js lcs rs = | |
| fs', gs', hs', is', js'] | ||
| calt = concat altogether | ||
|
|
||
| -- Calculate what chunks are depended on (i.e., UID -> Dependants) | ||
| chDpdts = invert $ M.fromList $ map (\c -> (c ^. uid, S.toList $ chunkRefs c)) calt | ||
| -- Calculate what chunks are depended on (i.e., UID -> Dependants), but only | ||
| -- keep dependencies that correspond to chunks we are actually inserting or | ||
| -- that already exist in the chunk table. References/LabelledContent live in | ||
| -- separate tables and are handled elsewhere. | ||
| allowedDeps = S.fromList (M.keys (chunkTable strtr) ++ map (^. uid) calt) | ||
| chDpdts = invert $ M.fromList $ | ||
| map (\c -> (c ^. uid, S.toList $ S.filter (`S.member` allowedDeps) (chunkRefs c))) calt | ||
|
Comment on lines
+264
to
+270
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not quite sure I'm understanding this change. Does it not make it so that any chunk dependancy that is neither already in the |
||
|
|
||
| -- Insert all incoming chunks with the existing chunk table, asserting that | ||
| -- none of the inserted chunks were already inserted. | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -150,7 +150,7 @@ symbMap = cdb (map (^. output) iMods ++ symbolsAll) ideaDicts conceptChunks [] | |
|
|
||
| -- | Holds all references and links used in the document. | ||
| allRefs :: [Reference] | ||
| allRefs = [externalLinkRef] | ||
| allRefs = externalLinkRef : SRS.sectionReferences ++ map ref (labelledContent ++ funcReqsTables) | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Was this really needed? The |
||
|
|
||
| stdFields :: Fields | ||
| stdFields = [DefiningEquation, Description Verbose IncludeUnits, Notes, Source, RefBy] | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,6 +5,7 @@ module Drasil.GlassBR.Assumptions (assumpGT, assumpGC, assumpES, assumpSV, | |
| import Language.Drasil hiding (organization) | ||
| import qualified Language.Drasil.Development as D | ||
| import qualified Drasil.DocLang.SRS as SRS (valsOfAuxCons) | ||
| import Control.Lens (view) | ||
| import Language.Drasil.Chunk.Concept.NamedCombinators | ||
| import qualified Language.Drasil.NounPhrase.Combinators as NP | ||
| import qualified Language.Drasil.Sentence.Combinators as S | ||
|
|
@@ -68,7 +69,7 @@ standardValuesDesc :: UnitalChunk -> Sentence | |
| standardValuesDesc mainIdea = foldlSent [D.toSent $ atStartNP' (the value), S "provided in", | ||
| refS $ SRS.valsOfAuxCons ([]::[Contents]) ([]::[Section]), S "are assumed for the", phrase mainIdea, | ||
| sParen (ch mainIdea) `sC` S "and the", plural materialProprty `S.of_` | ||
| foldlList Comma List (map ch (take 3 assumptionConstants))] | ||
| foldlList Comma List (map (ch . view defLhs) assumptionConstants)] | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
|
||
| glassLiteDesc :: Sentence | ||
| glassLiteDesc = foldlSent [atStart glass, S "under consideration is assumed to be a single", | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -19,9 +19,10 @@ import Data.Drasil.Concepts.Physics (acceleration, collision, distance, gravity, | |
| import Drasil.Projectile.Concepts (launcher, projectile, target, projMotion) | ||
|
|
||
| assumptions :: [ConceptInstance] | ||
| assumptions = [twoDMotion, cartSyst, yAxisGravity, launchOrigin, targetXAxis, | ||
| posXDirection, constAccel, accelXZero, accelYGravity, neglectDrag, pointMass, | ||
| freeFlight, neglectCurv, timeStartZero, gravAccelValue] | ||
| -- Order matters: each assumption appears after those it references so generated SRS links work. | ||
| assumptions = [twoDMotion, neglectCurv, cartSyst, yAxisGravity, accelYGravity, | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why the reorder?
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I reorder the assumptions so that each assumption appears after any other assumptions it refers to in its description. In The new order ensures that all referenced assumptions are introduced before they are linked.
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Great. Please add a comment to that effect. (And everywhere else you did this.) |
||
| launchOrigin, targetXAxis, posXDirection, neglectDrag, pointMass, | ||
| freeFlight, accelXZero, constAccel, timeStartZero, gravAccelValue] | ||
|
|
||
| twoDMotion, cartSyst, yAxisGravity, launchOrigin, targetXAxis, | ||
| posXDirection, constAccel, accelXZero, accelYGravity, neglectDrag, | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,11 +1,11 @@ | ||
| module Drasil.Projectile.References where | ||
|
|
||
| import Language.Drasil | ||
| import Data.Drasil.Citations (cartesianWiki, accelerationWiki, velocityWiki, | ||
| import Data.Drasil.Citations (accelerationWiki, velocityWiki, | ||
| hibbeler2004, parnasClements1986, koothoor2013, smithKoothoor2016, smithEtAl2007, | ||
| smithLai2005) | ||
|
|
||
| citations :: BibRef | ||
| citations = [accelerationWiki, velocityWiki, hibbeler2004, cartesianWiki, | ||
| citations = [accelerationWiki, velocityWiki, hibbeler2004, | ||
| parnasClements1986, koothoor2013, smithKoothoor2016, smithEtAl2007, | ||
| smithLai2005] |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -31,8 +31,9 @@ import Drasil.SWHS.Unitals (wVol, volHtGen, tempC, tempInit, tempW, | |
| ------------------------- | ||
|
|
||
| assumptions :: [ConceptInstance] | ||
| -- Order matters: each assumption appears after those it references so generated SRS links work. | ||
| assumptions = [assumpTEO, assumpHTCC, assumpCWTAT, assumpTPCAV, assumpDWPCoV, assumpSHECoV, | ||
| assumpLCCCW, assumpTHCCoT, assumpTHCCoL, assumpLCCWP, assumpCTNOD, assumpSITWP, | ||
| assumpLCCCW, assumpTHCCoT, assumpTHCCoL, assumpLCCWP, assumpSITWP, assumpCTNOD, | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. re-order? |
||
| assumpPIS, assumpWAL, assumpPIT, assumpNIHGBWP, assumpVCMPN, assumpNGSP, | ||
| assumpAPT, assumpVCN] | ||
|
|
||
|
|
||
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.
Why have these changed order? We should make such changes unless there is a good reason to. Previous were in strict alphabetical order.
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.
Because this change ensures every derived unit is inserted after the units it depends on.
For example,
pascalprecedeskilopascal,voltprecedesfarad/ohm, andweberprecedestesla/henry.Drasil/code/drasil-database/lib/Database/Drasil/ChunkDB.hs
Lines 175 to 178 in e36c1ec
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.
Excellent reason, thank you! You should put in a comment to that effect. I would make sure that the base units are in alphabetical order, and then by dependency (+alphabetical) order after that.