Drasil
Drasil copied to clipboard
Remove `SystemInformation`s `_instModels` field
I added the _instModels
field to SystemInformation
so that we can pass around information about which InstanceModels
are relevant to SRS. Right now, the ChunkDB
s of each problem contains only the InstanceModel
s relevant to their own problem, and each one is presumably displayed in the SRS (and used). So, we should be able to naively remove this _instModels
field from SystemInformation
, replacing accessors to it with an accessor to the ChunkDB
that gathers all the InstanceModel
s automatically.
Can I have the file path? Let me take a look
Hi @daijingz, SystemInformation
is defined in drasil-sysinfo
, it's one of the few files there. grep will be helpful for searching where it is used too.
Let me find the corresponding code first.
I see the file at this path: C:\Users\david\Drasil\code\drasil-sysinfo\lib\SysInfo\Drasil\SystemInformation.hs. I hope it is right. There are two places with the "_instModels" fields: one on line 13, and another on line 55. I think I should delete them from the code. This is the first step.
How to do the next step "replacement"? Seems like chunkDB is an external Haskell library. Can you give me more information?
Here is the modified code: (I delete all instModel matchings)
Other places I have not changed, and I guess this is the first part "removing"
You need to make a PR for us to evaluate your changes.
You need to make a PR for us to evaluate your changes.
Dr.Carette, I feel this is still an unsaved change. I have not submitted this change since I feel there are some other places that required to be changed, and I need some further assistance. Now I am still reading relevant codes. Give me more time please.
Do all the tests pass?
I realize simple deletion is not working well, let me do it again.
If it had been that easy, we would have done it already!!!
Hi @daijingz, I think it might be better to have a look at one of the tickets labelled 'newcomers', they should all have a clearer path to resolution. While I wrote this ticket, I don't think I like the described solution anymore -- I will need to write up a follow-up discussion/issue later today.
Let me show the works that I have already done because this issue I feel, it indicates many possible improvements needed in the future.
Here is my newest work two days ago (I forgot to indicate): In my understanding, the required replacement is "replacing the given type "instanceModel" in the SystemInformation data with ChunkDB", so several different kinds of functions need to parse ChunkDB (Not the list of "InstanceModel") in the data SystemInformation. I think the difficulty appears in the transformation.
Let me do some research about the ChunkDB and the InstanceModels
Let me try it again The command grep shows this word mentioned at almost all different objects: $ grep "instModels" -r * --include "*.hs" drasil-code/lib/Language/Drasil/CodeSpec.hs: , _instModels = ims drasil-example/dblpendulum/lib/Drasil/DblPendulum/Body.hs: _instModels = iMods, drasil-example/gamephysics/lib/Drasil/GamePhysics/Body.hs: _instModels = iMods, drasil-example/glassbr/lib/Drasil/GlassBR/Body.hs: _instModels = iMods, drasil-example/hghc/lib/Drasil/HGHC/Body.hs: _instModels = [], -- FIXME; empty _instModels drasil-example/nopcm/lib/Drasil/NoPCM/Body.hs: _instModels = NoPCM.iMods, drasil-example/pdcontroller/lib/Drasil/PDController/Body.hs: _instModels = instanceModels, drasil-example/projectile/lib/Drasil/Projectile/Body.hs: _instModels = iMods, drasil-example/projectile/lib/Drasil/Projectile/Lesson/Body.hs: _instModels = [], drasil-example/sglpendulum/lib/Drasil/SglPendulum/Body.hs: _instModels = iMods, drasil-example/ssp/lib/Drasil/SSP/Body.hs: _instModels = SSP.iMods, drasil-example/swhs/lib/Drasil/SWHS/Body.hs: _instModels = insModel, drasil-example/template/lib/Drasil/Template/Body.hs: _instModels = [] :: [InstanceModel], drasil-sysinfo/lib/SysInfo/Drasil/SystemInformation.hs: instModels, datadefs, configFiles, inputs, purpose, background, drasil-sysinfo/lib/SysInfo/Drasil/SystemInformation.hs: , _instModels :: [InstanceModel] drasil-website/lib/Drasil/Website/Body.hs: _instModels = [],
@balacij I am doing more research about the ChunkDb library because, in this issue, there are a lot of occurrences with the ChunkDB library usage. I am quite confused with these values and variable callings. I found some ChunkDB tutorial resources, and I heard you were an expert with lots of practical expertise. Can you tell me the way about how to do personal research and learn more about the ChunkDB library efficiently? I want to learn more information about this, and it is necessary for me to solve this issue with more relevant information now. I am looking at this: https://github.com/JacquesCarette/Drasil/wiki/Chunks, but I feel this does not help my coding.
@JacquesCarette Another problem is the overall structure. Up to now, I don't have a clear understanding of what each of the mentioned files does, I see lots of information on the Drasil wiki, but my information ideas are still messy. How should I find out what each part does? I feel the Drasil Wiki provides too much abstract information.
This aspect of Drasil is highly under-documented. The only way to find out about it is to read the code.
To add, I think it would be better to choose a different ticket @daijingz. I don't think I'm happy with the solution I described above anymore.