Drasil icon indicating copy to clipboard operation
Drasil copied to clipboard

Remove `SystemInformation`s `_instModels` field

Open balacij opened this issue 1 year ago • 18 comments

I added the _instModels field to SystemInformation so that we can pass around information about which InstanceModels are relevant to SRS. Right now, the ChunkDBs of each problem contains only the InstanceModels 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 InstanceModels automatically.

balacij avatar Jun 14 '23 15:06 balacij

Can I have the file path? Let me take a look

daijingz avatar Jul 13 '23 20:07 daijingz

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.

balacij avatar Jul 13 '23 20:07 balacij

Let me find the corresponding code first.

daijingz avatar Jul 21 '23 04:07 daijingz

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?

daijingz avatar Jul 21 '23 05:07 daijingz

Here is the modified code: (I delete all instModel matchings) T SEFP MK44@P@FF SRGAN4 ~F4VCP{KA M04V)2${HJB0T Other places I have not changed, and I guess this is the first part "removing"

daijingz avatar Jul 22 '23 04:07 daijingz

You need to make a PR for us to evaluate your changes.

JacquesCarette avatar Jul 22 '23 11:07 JacquesCarette

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.

daijingz avatar Jul 23 '23 02:07 daijingz

Do all the tests pass?

JacquesCarette avatar Jul 23 '23 12:07 JacquesCarette

I realize simple deletion is not working well, let me do it again.

daijingz avatar Jul 23 '23 16:07 daijingz

If it had been that easy, we would have done it already!!!

JacquesCarette avatar Jul 23 '23 19:07 JacquesCarette

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.

balacij avatar Jul 24 '23 19:07 balacij

Let me show the works that I have already done because this issue I feel, it indicates many possible improvements needed in the future.

daijingz avatar Jul 25 '23 01:07 daijingz

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

daijingz avatar Jul 26 '23 05:07 daijingz

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 = [],

daijingz avatar Aug 09 '23 05:08 daijingz

@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.

daijingz avatar Aug 29 '23 06:08 daijingz

@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.

daijingz avatar Aug 29 '23 06:08 daijingz

This aspect of Drasil is highly under-documented. The only way to find out about it is to read the code.

JacquesCarette avatar Aug 29 '23 16:08 JacquesCarette

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.

balacij avatar Aug 29 '23 17:08 balacij