----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/13738/#review25505 -----------------------------------------------------------
http://svn.apache.org/repos/asf/incubator/climate/trunk/ocw/dataset.py <https://reviews.apache.org/r/13738/#comment49955> We could define err_msg before the if-statements and then check later if it's set and raise an error from there. Might clean this up a bit. Similarly we could chain all the if's together into one if-elif. But then again this is really just me spouting my personal preferences. Something like this is what I'm talking about: err_msg = None lat_count = lats.shape[0] lon_count = lons.shape[0] time_count = times.shape[0] if lat_dim != 1: err_msg = "blah" elif lon_dim != 1: err_msg = "blah" ... elif values.shape != (time_count, ...): err_msg = "blah" if err_msg: raise ValueError(err_msg) http://svn.apache.org/repos/asf/incubator/climate/trunk/ocw/dataset.py <https://reviews.apache.org/r/13738/#comment49954> Have you checked that the formatting of this string looks proper when run? I just ran a similar test case and I ended up with a tab in front of the second line. Not sure if that's the look we were going for or not with this. - Michael Joyce On Aug. 22, 2013, 3:15 p.m., Cameron Goodale wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/13738/ > ----------------------------------------------------------- > > (Updated Aug. 22, 2013, 3:15 p.m.) > > > Review request for Apache Open Climate and Michael Joyce. > > > Bugs: CLIMATE-274 > https://issues.apache.org/jira/browse/CLIMATE-274 > > > Repository: climate > > > Description > ------- > > I created 5 different ValueError exception error messages for each different > check we perform when a Dataset object is initialized. > > > Diffs > ----- > > http://svn.apache.org/repos/asf/incubator/climate/trunk/ocw/dataset.py > 1516193 > > Diff: https://reviews.apache.org/r/13738/diff/ > > > Testing > ------- > > I re-ran test_dataset.py and all 23 tests pass. > > > Thanks, > > Cameron Goodale > >
