{% set name = "mpas_tools" %}
{% set version = "0.23.0" %}

package:
  name: {{ name|lower }}
  version: {{ version }}

source:
  path: ../..

build:
  number: 0
  entry_points:
    - planar_hex = mpas_tools.planar_hex:main
    - translate_planar_grid = mpas_tools.translate:main
    - merge_grids = mpas_tools.merge_grids:main
    - split_grids = mpas_tools.split_grids:main
    - inject_bathymetry = mpas_tools.ocean.inject_bathymetry:main
    - inject_preserve_floodplain = mpas_tools.ocean.inject_preserve_floodplain:main
    - mpas_to_triangle = mpas_tools.mesh.creation.mpas_to_triangle:main
    - triangle_to_netcdf = mpas_tools.mesh.creation.triangle_to_netcdf:main
    - jigsaw_to_netcdf = mpas_tools.mesh.creation.jigsaw_to_netcdf:main
    - scrip_from_mpas = mpas_tools.scrip.from_mpas:main
    - ocean_add_depth = mpas_tools.ocean.depth:main_add_depth
    - ocean_add_zmid = mpas_tools.ocean.depth:main_add_zmid
    - ocean_write_time_varying_zmid = mpas_tools.ocean.depth:main_write_time_varying_zmid
    - plot_ocean_transects = mpas_tools.ocean.viz.transects:main
    - compute_mpas_region_masks = mpas_tools.mesh.mask:entry_point_compute_mpas_region_masks
    - compute_mpas_transect_masks = mpas_tools.mesh.mask:entry_point_compute_mpas_transect_masks
    - compute_mpas_flood_fill_mask = mpas_tools.mesh.mask:entry_point_compute_mpas_flood_fill_mask
    - compute_lon_lat_region_masks = mpas_tools.mesh.mask:entry_point_compute_lon_lat_region_masks
    - compute_projection_region_masks = mpas_tools.mesh.mask:entry_point_compute_projection_grid_region_masks
    - prepare_seaice_partitions = mpas_tools.seaice.partition:prepare_partitions
    - create_seaice_partitions = mpas_tools.seaice.partition:create_partitions
    - simple_seaice_partitions = mpas_tools.seaice.partition:simple_partitions
    - sort_mesh = mpas_tools.mesh.creation.sort_mesh:main

requirements:
  build:
    - {{ compiler('cxx') }}
    - {{ compiler('fortran') }}
    - cmake
    - pkgconfig
  host:
    - python
    - hdf5
    - hdf5 * nompi_*
    - libnetcdf
    - libnetcdf * nompi_*
    - netcdf-fortran
    - netcdf-fortran * nompi_*
    - setuptools
    - netcdf4
    - openmp  # [osx]

  run:
    - python
    - cartopy
    - cmocean
    - dask
    - geometric_features >=1.0.1,<2.0.0
    - hdf5
    - importlib_resources  # [py<=38]
    - inpoly
    - jigsaw >=0.9.12
    - jigsawpy >=0.2.1
    - libnetcdf
    - netcdf-fortran
    - matplotlib-base
    - netcdf4
    - numpy
    - progressbar2
    - pyamg
    - pyevtk
    - pyproj
    - python-igraph
    - scikit-image !=0.20.0
    - scipy
    - shapely >=2.0,<3.0
    - xarray

test:
  requires:
    - pytest
    - requests
    - pip
  source_files:
    - mesh_tools/mesh_conversion_tools/test/Arctic_Ocean.geojson
    - mesh_tools/mesh_conversion_tools/test/mesh.QU.1920km.151026.nc
    - mesh_tools/mesh_conversion_tools/test/land_mask_final.nc
    - conda_package/mpas_tools/tests/*
  imports:
    - mpas_tools
    - mpas_tools.mesh.conversion
    - mpas_tools.mesh.creation
    - mpas_tools.viz
    - mpas_tools.conversion
  commands:
    - planar_hex --nx=10 --ny=20 --dc=1000. --outFileName='periodic_mesh_10x20_1km.nc'
    - translate_planar_grid -f 'periodic_mesh_10x20_1km.nc' -x 1000. -y 2000.
    - translate_planar_grid -f 'periodic_mesh_10x20_1km.nc' -c
    - planar_hex --nx=20 --ny=40 --dc=1000. --outFileName='periodic_mesh_20x40_1km.nc'
    - translate_planar_grid -f 'periodic_mesh_10x20_1km.nc' -d 'periodic_mesh_20x40_1km.nc'
    - MpasMeshConverter.x mesh_tools/mesh_conversion_tools/test/mesh.QU.1920km.151026.nc mesh.nc
    - sort_mesh --mesh-file mesh.nc --sort-file sorted_mesh.nc
    - MpasCellCuller.x mesh.nc culled_mesh.nc -m mesh_tools/mesh_conversion_tools/test/land_mask_final.nc
    # - MpasMaskCreator.x mesh.nc arctic_mask.nc -f mesh_tools/mesh_conversion_tools/test/Arctic_Ocean.geojson
    - planar_hex --nx=30 --ny=20 --dc=1000. --npx --npy --outFileName='nonperiodic_mesh_30x20_1km.nc'
    - MpasCellCuller.x nonperiodic_mesh_30x20_1km.nc culled_nonperiodic_mesh_30x20_1km.nc
    - python -m pytest conda_package/mpas_tools/tests
    - mark_horns_for_culling.py --help
    - set_lat_lon_fields_in_planar_grid.py --help
    - create_SCRIP_file_from_MPAS_mesh.py --help
    - create_SCRIP_file_from_planar_rectangular_grid.py --help
    - prepare_seaice_partitions --help
    - create_seaice_partitions --help
    - fix_regrid_output.exe
    - create_landice_grid_from_generic_MPAS_grid.py --help
    - define_cullMask.py --help
    - interpolate_to_mpasli_grid.py --help
    - mark_domain_boundaries_dirichlet.py --help
    - add_land_locked_cells_to_mask.py --help
    - widen_transect_edge_masks.py --help
    - add_critical_land_blockages_to_mask.py --help
    - moc_southern_boundary_extractor.py --help
    - ocean_add_depth --help
    - ocean_add_zmid --help
    - ocean_write_time_varying_zmid --help
    - paraview_vtk_field_extractor.py -f mesh_tools/mesh_conversion_tools/test/mesh.QU.1920km.151026.nc -v latCell,lonCell --ignore_time -o vtk_test
    - split_grids --help
    - merge_grids --help
    - inject_bathymetry mesh_tools/mesh_conversion_tools/test/mesh.QU.1920km.151026.nc
    - inject_preserve_floodplain --help
    - mpas_to_triangle --help
    - triangle_to_netcdf --help
    - jigsaw_to_netcdf --help
    - scrip_from_mpas --help
    - compute_mpas_region_masks --help
    - compute_mpas_transect_masks --help
    - compute_mpas_flood_fill_mask --help
    - compute_lon_lat_region_masks --help
    - compute_projection_region_masks --help
    - pip check

about:
  home: https://github.com/MPAS-Dev/MPAS-Tools/
  license: BSD-3-Clause
  license_family: BSD
  license_file: LICENSE
  summary: Mesh tools for Model for Prediction Across Scales (MPAS)
  description: |
    A set of tools for creating and manipulating meshes for the climate
    components based on the Model for Prediction Across Scales (MPAS) framework
  doc_url: https://github.com/MPAS-Dev/MPAS-Tools/README.md
  dev_url: https://github.com/MPAS-Dev/MPAS-Tools/

extra:
  recipe-maintainers:
    - xylar
    - jhkennedy
