rpoleski / MulensModel

Microlensing Modelling package
https://rpoleski.github.io/MulensModel/
Other
57 stars 15 forks source link

Coverage of code by unit tests should be increased #65

Open rpoleski opened 1 year ago

rpoleski commented 1 year ago

Currently coverage is 72% and we should work on increasing it.

rpoleski commented 1 year ago

I've went through output of coverage code and noted the functions which should be covered better by tests. I know it's a lot of work, but we need such a list to start the work. The list is above.

jenniferyee commented 1 year ago

Implemented in commit 562bc2a

  1. event.py init() with fix_source_flux_ratio
  2. event.py calculate_chi2_gradient() with one parameter (but test FAILS)
jenniferyee commented 1 year ago

In addition to the unit tests, mentioned above, many lines of event.py are not covered by unittests. I am working on making them more complete.

@rpoleski Line 131 is not covered by unit tests. However, in reviewing the data_ref.setter, I find that data_ref is now always int. So, I think:

Lines 128--131:

            if isinstance(self.data_ref, (int)):
                data_ref = self.datasets[self.data_ref]
            else:
                data_ref = self.data_ref

-->

            data_ref = self.datasets[self.data_ref]

Agree?

jenniferyee commented 1 year ago

event.py missing code coverage (wrt commit fa1886b72848768717ae541cd24f2f64bf9027fb):

184-198, plot() 208-254, _plot_lc_default() 260-279, _plot_trajectory_default() 296-300, plot_model() 342-381, plot_data() 394-438, plot_residuals() 446-450, plot_trajectory() 461-467, plot_source_for_datasets()

567, `fit_blending, deprecated 585, fit_blending, deprecated 613, fit_blending, deprecated 649, fit_blending, deprecated 683, fit_blending, deprecated

761-764, _sum()

950, comment 984, comment 1016, deprecated 1028, deprecated 1039, deprecated 1043-1052 deprecated