peter-michalski / LatticeBoltzmannSolvers

CAS741: Development of Scientific Computing Software - Course Project
Other
0 stars 0 forks source link

Please build Module 3 of my MIS using python #45

Closed peter-michalski closed 4 years ago

peter-michalski commented 4 years ago

Hi @Ao99 ,

I am assigning you to build Module 3: Input Reading Module of my MIS using python. For clarity, the entire module is just one function what will return a dictionary data structure. The function has no input parameters when called.

The function is to read the inputs of a file titled "input.txt" that will be located in the Input directory (which will be in the same directory as the module code). The text file will simply be multiple lines of code in the format: string, number string, number string, number ...

The code must read each line and input the string, number into a dictionary that matches each lines string (which will be the 'key') to the number present on the same line.

Once all the lines are read, the new dictionary object will be passed into a function titled verifyInputs(dictionary object). I will make this function as it is another Module, however this function returns a boolean value (i have to make a slight adjustment in my M4 MIS as I forgot to add this) - If the returned boolean is true, then M3 will then itself return the dictionary object to the module that called module 3. If this is unclear in any way please ask.

Note: if the file is missing from the directory please print exception NotFound as listed in Appendix table 2. If the file has a problem reading the input (perhaps bad format) then please print the error titled ErrorRead also found in the Appendix table 2.

If you have any questions please ask!

This may be useful: https://www.w3schools.com/python/python_dictionaries.asp

smiths commented 4 years ago

@peter-michalski, that sounds like a good description of what Module 3 does. I wonder if you should incorporate most of this into your MIS? If it is really necessary, then it is should be documented. (I haven't actually looked at your MIS, so you might be repeating information in your issue that is already in the MIS. If that is the case, you can ignore more observation.)

Ao99 commented 4 years ago

Implemented and uploaded. 2ec976cd5b430961f325dd87c83c885d538534dc I did some simple tests with fake DataStructure and InputChecking modules built by myself, but you might still need to modify according to your needs.

smiths commented 4 years ago

@peter-michalski, it looks like the version by @Ao99 is the one you used in your implementation. Can you please confirm? This would be the first example that I have come across where the domain expert version actually made it to the finished code. If that is the case, your detailed description above is likely part of the reason. It would be nice if information outside of the MIS was not necessary. In the future we'll have to think about how to improve the MIS, possibly through additional comments/details. Regardless, from the point of view of CAS 741, this looks like a success. Thank you both.

peter-michalski commented 4 years ago

I did not directly use the version that was implemented (I used M3InputReading.py) by @Ao99, partially because of some later changes to my design, but I did build off of it. It was definitely helpful.

peter-michalski commented 4 years ago

I had left @Ao99 file exactly as he had created it as 1) I decided to go with a different naming convention for my files 2) I did not want to cause any confusion in regard to the grading of his contribution by changing the name of his contribution or the contents.

In retrospect I guess I could have gone ahead with changes considering we are using Git..

smiths commented 4 years ago

Thank you for the information @peter-michalski. Because of version control, it would have been fine if you modified the version by @Ao99. I could always see the original, and who changed any given line. I think if I do this experiment again, I'll make a point of pointing this out. Having other implement modules could have gone better, but it was a good start. :smile: