Skip to content

Commit

Permalink
Minor corrections to magnification=1.0, issue #111
Browse files Browse the repository at this point in the history
  • Loading branch information
rapoliveira committed Dec 22, 2023
1 parent d5e78a8 commit 63aa94e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions examples/example_16/ulens_model_fit.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
except Exception:
raise ImportError('\nYou have to install MulensModel first!\n')

__version__ = '0.34.2'
__version__ = '0.34.3'


class UlensModelFit(object):
Expand Down Expand Up @@ -3119,7 +3119,7 @@ def _mark_second_Y_axis_in_best_plot(self):
ticks = mm.Utils.get_mag_from_flux(flux)
ax2.set_ylabel(label).set_color(color)
ax2.spines['right'].set_color(color)
ax2.set_ylim(ticks[0], ylim[1])
ax2.set_ylim(ylim[0], ylim[1])
ax2.tick_params(axis='y', colors=color)
plt.yticks(ticks, labels, color=color)

Expand All @@ -3144,7 +3144,7 @@ def _second_Y_axis_optimal(self, ax2, A_min, A_max):
ax2.set_ylim(A_min, A_max)
A_values = ax2.yaxis.get_ticklocs().round(7)
A_values = A_values[(A_values >= max(1, A_min)) & (A_values < A_max)]
if 1. not in A_values:
if 1. not in A_values and A_min <= 1:
A_values = np.insert(A_values, 0, 1.)
is_integer = [mag.is_integer() for mag in A_values]
if all(is_integer):
Expand Down Expand Up @@ -3176,7 +3176,7 @@ def _second_Y_axis_warnings(self, flux, labels, A_values, A_min, A_max):
"be translated to magnitudes.")
warnings.warn(msg.format(np.sum(np.logical_not(mask))))

if (np.min(A_values) < min(A_min, 1) or np.max(A_values) > A_max or
if (np.min(A_values) < A_min or np.max(A_values) > A_max or
np.any(flux < 0.)):
msg = ("Provided magnifications for the second (i.e., right-hand "
"side) Y-axis scale are from {:} to {:},\nbut the range "
Expand Down

0 comments on commit 63aa94e

Please sign in to comment.