Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix test against collect #55

Merged
merged 31 commits into from
Dec 3, 2019
Merged

Fix test against collect #55

merged 31 commits into from
Dec 3, 2019

Commits on Oct 23, 2019

  1. Finish implementing test_against_collect

    Also removes dependency on saved binary files.
    johnomotani committed Oct 23, 2019
    Configuration menu
    Copy the full SHA
    7491906 View commit details
    Browse the repository at this point in the history
  2. pip-install boutdata for Travis tests

    Required for test_against_collect
    johnomotani committed Oct 23, 2019
    Configuration menu
    Copy the full SHA
    896459b View commit details
    Browse the repository at this point in the history
  3. Include BOUT_VERSION in create_bout_ds

    This is needed for BOUT++'s 'collect' function to work correctly, as for
    BOUT_VERSION<3.5 it was necessary to ignore the last point in the
    z-grid, so collect needs to be able to check the BOUT_VERSION.
    johnomotani committed Oct 23, 2019
    Configuration menu
    Copy the full SHA
    d7b5971 View commit details
    Browse the repository at this point in the history
  4. Remove MYPE, PE_XIND and PE_YIND from METADATA_VARS

    These scalar variables change from processor to processor, so are
    dropped when loading a dataset and cannot be checked.
    johnomotani committed Oct 23, 2019
    Configuration menu
    Copy the full SHA
    ba95d92 View commit details
    Browse the repository at this point in the history
  5. Drop _BOUT_PER_PROC_VARIABLES in test_load

    In some tests, these need to be dropped in addition to METADATA_VARS
    before comparing generated and loaded datasets.
    johnomotani committed Oct 23, 2019
    Configuration menu
    Copy the full SHA
    1c97746 View commit details
    Browse the repository at this point in the history
  6. Fix load._get_limit() for case when number of guard cells is 0

    Returning 0 for an upper limit causes a bug, as the data is sliced with
    slice(lower, upper), where upper=-<number of guard cells>, but -0=0 so
    the slice would remove all the data.
    johnomotani committed Oct 23, 2019
    Configuration menu
    Copy the full SHA
    5fdf62b View commit details
    Browse the repository at this point in the history
  7. Define custom xBOUTWarning

    Can then ignore it safely in the test suite.
    johnomotani committed Oct 23, 2019
    Configuration menu
    Copy the full SHA
    d3278e5 View commit details
    Browse the repository at this point in the history
  8. Suppress warning from xarray

    Many tests produce a warning from xarray like:
    RuntimeWarning: deallocating CachingFileManager(<class 'netCDF4._netCDF4.Dataset'>, '/tmp/pytest-of-***/<path-to-file>', mode='r', kwargs={'clobber': True, 'diskless': False, 'persist': False, 'format': 'NETCDF4'}), but file is not already closed. This may indicate a bug.
    Ignore these warnings, as they do not tell us anything useful about
    xBOUT.
    johnomotani committed Oct 23, 2019
    Configuration menu
    Copy the full SHA
    93f6f91 View commit details
    Browse the repository at this point in the history
  9. pip-install vtk in .travis.yml, workaround for Python-3.6 install

    In Python-3.6 the mayavi install fails if vtk is not available. mayavi
    is a dependency of boutdata, needed for test_against_collect. As a
    workaround, pip-install vtk before pip-installing boutdata.
    johnomotani committed Oct 23, 2019
    Configuration menu
    Copy the full SHA
    740c822 View commit details
    Browse the repository at this point in the history
  10. PEP8 fixes

    johnomotani committed Oct 23, 2019
    Configuration menu
    Copy the full SHA
    212f913 View commit details
    Browse the repository at this point in the history

Commits on Oct 24, 2019

  1. Configuration menu
    Copy the full SHA
    b970c1a View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    807c8e3 View commit details
    Browse the repository at this point in the history

Commits on Oct 25, 2019

  1. Add option to pass grid file

    May be needed to provide some variables that are not saved by default to
    BOUT++'s output files, e.g. psixy, Rxy, Zxy.
    johnomotani committed Oct 25, 2019
    Configuration menu
    Copy the full SHA
    f8fa440 View commit details
    Browse the repository at this point in the history
  2. Add 'hthe' from grid in s-alpha geometry

    Need to add hthe before getting toroidal coordinates, as dimension names
    are changed only in the Dataset, not in the _grid member variable.
    
    'r' coordinate is created as 1d, so selecting 'theta=0' part is an
    error.
    johnomotani committed Oct 25, 2019
    Configuration menu
    Copy the full SHA
    4fad704 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    181a691 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    60b9d9a View commit details
    Browse the repository at this point in the history

Commits on Oct 26, 2019

  1. Don't store _grid in dataset attrs

    Doing this prevented the dataset being saved to netCDF file.
    
    Also use _open_grid instead of open_boutdataset to open the grid file so
    that the grid dataset does not have metadata added to the DataArray
    variables. These variables are added as coordinates and become members
    of the DataArrays representing simulation variables; if they have a
    metadata dict, it is not possible to save them to netCDF.
    johnomotani committed Oct 26, 2019
    Configuration menu
    Copy the full SHA
    cfc039c View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    7ae0f18 View commit details
    Browse the repository at this point in the history
  3. Do not save hthe in dataset for s-alpha geometry

    ...when hthe is loaded from the grid file. Variables from the grid file
    do not have all the correct metadata, so cause errors when trying to
    save to netCDF.
    johnomotani committed Oct 26, 2019
    Configuration menu
    Copy the full SHA
    3fc4f02 View commit details
    Browse the repository at this point in the history
  4. Remove workaround for mayavi dependency of boutdata

    Depedency has been made optional by an update to boututils.
    johnomotani committed Oct 26, 2019
    Configuration menu
    Copy the full SHA
    75f3072 View commit details
    Browse the repository at this point in the history

Commits on Oct 28, 2019

  1. Remove workaround for mayavi dependency of boutdata

    Depedency has been made optional by an update to boututils.
    johnomotani committed Oct 28, 2019
    Configuration menu
    Copy the full SHA
    7c05112 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    4902a74 View commit details
    Browse the repository at this point in the history
  3. Revert addition of xBOUTWarning

    Instead use UserWarning, and in pytest.ini set a filter on the warning
    message.
    johnomotani committed Oct 28, 2019
    Configuration menu
    Copy the full SHA
    4a86947 View commit details
    Browse the repository at this point in the history

Commits on Dec 3, 2019

  1. Merge pull request #58 from boutproject/test-geometries

    Test geometries
    johnomotani authored Dec 3, 2019
    Configuration menu
    Copy the full SHA
    5047941 View commit details
    Browse the repository at this point in the history
  2. Don't try to store grid dataset after reading coordinates

    Previously, a gridfile was loaded and stored as an attribute of the
    Dataset and DataArrays, then it was attempted to store the grid Dataset
    as a member of the BoutDataset accessor (this does not work because
    accessors are not permanent).
    
    As of BOUT++ v4.3.0, the only information we need to load from the grid
    file is some coordinates (e.g. psixy, Rxy, Zxy for 'toroidal' geometry),
    so we can just open the grid file, set the coordinates and not save the
    grid. This has the advantage that DataArrays inherit the coordinates
    from their parent Dataset without having to do special things when
    loading, or causing problems when saving to netCDF.
    johnomotani committed Dec 3, 2019
    Configuration menu
    Copy the full SHA
    bf9de54 View commit details
    Browse the repository at this point in the history
  3. Remove skipped grid_merge test

    We no longer merge grid data from a grid file into the Dataset, so this
    test is not needed.
    johnomotani committed Dec 3, 2019
    Configuration menu
    Copy the full SHA
    9922188 View commit details
    Browse the repository at this point in the history
  4. Fix passing MXG to _open_grid

    MXG is not contained in the grid file, so needs to be passed as an
    argument to _open_grid: read from the Dataset if one is being opened,
    otherwise defaults to 2.
    johnomotani committed Dec 3, 2019
    Configuration menu
    Copy the full SHA
    d7f8163 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    c099242 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    0583eac View commit details
    Browse the repository at this point in the history
  7. Skip test_against_collect if boutdata.collect is not available

    If boutdata.collect, 'old collect', is not available, then skip tests
    comparing to it. Ensures users who do not install old python tools can
    still run the tests.
    johnomotani committed Dec 3, 2019
    Configuration menu
    Copy the full SHA
    dcda0d3 View commit details
    Browse the repository at this point in the history
  8. Fix PEP8 issues

    johnomotani committed Dec 3, 2019
    Configuration menu
    Copy the full SHA
    5370f7d View commit details
    Browse the repository at this point in the history