Skip to content

Commit

Permalink
docstrings clarified and check added
Browse files Browse the repository at this point in the history
  • Loading branch information
rpoleski committed Sep 3, 2018
1 parent c633171 commit c147974
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 8 deletions.
28 changes: 21 additions & 7 deletions source/MulensModel/mulensdata.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ class MulensData(object):
Keywords :
data_list: [*list* of *lists*, *numpy.ndarray*], optional
columns: Date, Magnitude/Flux, Err
columns: Date, Magnitude/Flux, Error
file_name: *str*, optional
The path to a file with columns: Date, Magnitude/Flux,
Err. Loaded using np.loadtxt. See ``**kwargs``.
Err. Loaded using :py:func:`numpy.loadtxt()`. See ``**kwargs``.
**Either data_list or file_name is required.**
Expand Down Expand Up @@ -76,14 +76,26 @@ class MulensData(object):
Flags for good data, should be the same length as the
number of data points.
``**kwargs`` - :py:func:`np.loadtxt()` keywords. Used if
file_name is provided.
``**kwargs``: *dict*, optional
:py:func:`numpy.loadtxt()` keywords.
Used if *file_name* is provided.
Attributes (all vectors):
Attributes :
flux - the brightness in flux
flux: *numpy.ndarray*
The measured brightness in flux units.
err_flux - the errors on the fluxes
err_flux: *numpy.ndarray*
Uncertainties of *flux* values.
input_fmt: *str* ('mag', 'flux')
Input format - same as *phot_fmt* keyword in __init__.
chi2_fmt: *str* ('mag', 'flux')
Photometry format used for chi^2 calculations. Default is 'flux'.
ephemerides_file: *str*
File with satellite ephemeris.
"""

Expand Down Expand Up @@ -126,6 +138,8 @@ def __init__(self, data_list=None, file_name=None,
raise ValueError(m)
elif data_list is not None:
# ...from an array
if len(kwargs) > 0:
raise ValueError('data_list and kwargs cannot be both set')
(vector_1, vector_2, vector_3) = list(data_list)
self._initialize(
phot_fmt, time=vector_1, brightness=vector_2,
Expand Down
2 changes: 1 addition & 1 deletion source/MulensModel/version.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@

__version__ = "1.5.2"
__version__ = "1.5.3"

0 comments on commit c147974

Please sign in to comment.