grmpy icon indicating copy to clipboard operation
grmpy copied to clipboard

Reorganize complex functions and adjust flake8 conf appropriately

Open SeBecker opened this issue 7 years ago • 3 comments

So far our flake8 configuration file ignores complexity issues. We have to reorganize some functions. This concerns in particular:

  • print_info in simulate/simulate_auxiliary.py
  • print_logfile and write_comparison in estimate/estimate_output.py
  • test2 and test4 in test/test_unit.py
  • check_types and process in red/red_auxiliary.py
  • read_desc in test/auxiliary.py
  • generate_random_dict and print_dict in test/random_init.py

SeBecker avatar Sep 10 '18 10:09 SeBecker

I will start with this soon. The first step will include the implementations of janos' suggestions regarding the reading/printing process of the initialization files. Nevertheless this will be a bit time consuming since i have to ensure that this changes do not affect the results. I will provide an update as soon as I am able to present a first draft.

SeBecker avatar Dec 10 '18 15:12 SeBecker

I reorganized the whole random init file generating process since it was far to complex for fitting the flake8 standards. I was capable of reducing the number of code lines from over 400 to a little bit more than 200 while maintaining all current features except the specification of categorical variables. You can find the current draft here. The next steps will be to reorganize the read process as well as writing tests for comparing the old and the new random init file generator/read process via our regression test battery.

SeBecker avatar Dec 11 '18 14:12 SeBecker

I added a new draft for the initialization file import process (see here). The draft also includes a test setup which compares simulation results obtained with the help of the old import process with results that use the new one. This test is based on our regression test battery (see: Test3).

SeBecker avatar Dec 13 '18 13:12 SeBecker