Skip to content

Commit

Permalink
Fixed rescaling docstring bug
Browse files Browse the repository at this point in the history
  • Loading branch information
nick5435 committed Apr 16, 2017
1 parent a016164 commit 41a2d90
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ThermoPyle/ThermoPyle.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -543,15 +543,15 @@ def rescale(oldrange: List[Union[float, int]],
"""
def scaler(x:float)->float:
"""
scales input according to y = {delta_y}/{delta_x}*(x-{old_min})+ {new_min}
scales input according to y = {slope}*(x-{old_min})+{new_min}

Paramaters:
x (float): A value to scales
Returns:
y (float): the scaled version of x
"""
return (newrange[1] - newrange[0]) / (oldrange[1] - oldrange[0]) * (x - oldrange[0]) + newrange[0]
scaler.__doc__ = scaler.__doc__.format(delta_y=(newrange[1]-newrange[0]), delta_x=(oldrange[1]-oldrange[0]), old_min=oldrange[0],newmin=newrange[0])
scaler.__doc__ = scaler.__doc__.format(slope=((newrange[1]-newrange[0])/(oldrange[1]-oldrange[0])), old_min=oldrange[0], new_min=newrange[0])
return scaler
def fluid_contour_plot(fluid: Union[CSVFluid, ThermoFluid], xvar: Text="T", yvar: Text="P", contour: Text="U") -> None:
Expand Down

0 comments on commit 41a2d90

Please sign in to comment.