Skip to content

Commit

Permalink
Update the setup.py and conda recipe
Browse files Browse the repository at this point in the history
  • Loading branch information
xylar committed Jan 8, 2025
1 parent e0bae19 commit d943d6c
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 73 deletions.
10 changes: 4 additions & 6 deletions conda_package/recipe/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,11 @@
set -x
set -e

cp -r ocean landice visualization mesh_tools conda_package

cd conda_package
${PYTHON} -m pip install . --no-deps --no-build-isolation -vv

# build and install ocean topography smoothing tool
cd ${SRC_DIR}/conda_package/ocean/smooth_topo
cd ${SRC_DIR}/ocean/smooth_topo
mkdir build
cd build
cmake \
Expand All @@ -20,7 +18,7 @@ cmake --build .
cmake --install .

# build and install sea ice partitioning tool
cd ${SRC_DIR}/conda_package/mesh_tools/seaice_grid_tools
cd ${SRC_DIR}/mesh_tools/seaice_grid_tools
mkdir build
cd build
cmake \
Expand All @@ -31,7 +29,7 @@ cmake --build .
cmake --install .

# build and install legacy mask creator
cd ${SRC_DIR}/conda_package/mesh_tools/mesh_conversion_tools
cd ${SRC_DIR}/mesh_tools/mesh_conversion_tools
mkdir build
cd build
cmake \
Expand All @@ -42,7 +40,7 @@ cmake --build .
cp MpasMaskCreator.x ${PREFIX}/bin

# build and install mesh conversion tools
cd ${SRC_DIR}/conda_package/mesh_tools/mesh_conversion_tools_netcdf_c
cd ${SRC_DIR}/mesh_tools/mesh_conversion_tools_netcdf_c
mkdir build
cd build
cmake \
Expand Down
40 changes: 8 additions & 32 deletions conda_package/recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,30 +10,6 @@ source:

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:
Expand Down Expand Up @@ -110,17 +86,17 @@ test:
- 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
- mark_horns_for_culling --help
- set_lat_lon_fields_in_planar_grid --help
- create_scrip_file_from_mpas_mesh --help
- create_scrip_file_from_planar_rectangular_grid --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
- create_landice_grid_from_generic_mpas_grid --help
- define_landice_cull_mask --help
- interpolate_to_mpasli_grid --help
- mark_domain_boundaries_dirichlet --help
- add_land_locked_cells_to_mask.py --help
- widen_transect_edge_masks.py --help
- add_critical_land_blockages_to_mask.py --help
Expand Down
73 changes: 38 additions & 35 deletions conda_package/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

os.chdir(here)

for path in ['ocean', 'landice', 'visualization', 'mesh_tools']:
for path in ['ocean', 'visualization']:
destPath = './{}'.format(path)
if os.path.exists(destPath):
shutil.rmtree(destPath)
Expand Down Expand Up @@ -64,42 +64,45 @@
],
packages=find_packages(include=['mpas_tools', 'mpas_tools.*']),
package_data={'mpas_tools.viz': ['SciVisColorColormaps/*.xml']},
scripts=['mesh_tools/mesh_conversion_tools/mark_horns_for_culling.py',
'mesh_tools/planar_grid_transformations/set_lat_lon_fields_in_planar_grid.py',
'mesh_tools/create_SCRIP_files/create_SCRIP_file_from_MPAS_mesh.py',
'mesh_tools/create_SCRIP_files/create_SCRIP_file_from_planar_rectangular_grid.py',
'landice/mesh_tools_li/create_landice_grid_from_generic_MPAS_grid.py',
'landice/mesh_tools_li/define_cullMask.py',
'landice/mesh_tools_li/interpolate_to_mpasli_grid.py',
'landice/mesh_tools_li/mark_domain_boundaries_dirichlet.py',
'ocean/coastline_alteration/add_land_locked_cells_to_mask.py',
scripts=['ocean/coastline_alteration/add_land_locked_cells_to_mask.py',
'ocean/coastline_alteration/widen_transect_edge_masks.py',
'ocean/coastline_alteration/add_critical_land_blockages_to_mask.py',
'ocean/moc_southern_boundary_extractor/moc_southern_boundary_extractor.py',
'visualization/paraview_vtk_field_extractor/paraview_vtk_field_extractor.py'],
install_requires=install_requires,
entry_points={'console_scripts':
['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',
'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',
'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',
'sort_mesh = mpas_tools.mesh.creation.sort_mesh:main',
'scrip_from_mpas = mpas_tools.scrip.from_mpas: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',
'vector_reconstruct = mpas_tools.vector.reconstruct:main']})
entry_points={
'console_scripts': [
'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',
'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',
'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',
'sort_mesh = mpas_tools.mesh.creation.sort_mesh:main',
'scrip_from_mpas = mpas_tools.scrip.from_mpas: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',
'vector_reconstruct = mpas_tools.vector.reconstruct:main',
'mark_horns_for_culling = mpas_tools.mesh.mark_horns_for_culling:main',
'set_lat_lon_fields_in_planar_grid = mpas_tools.landice.set_lat_lon:main',
'create_scrip_file_from_mpas_mesh = mpas_tools.scrip.from_mpas:main',
'create_scrip_file_from_planar_rectangular_grid = mpas_tools.scrip.from_planar:main',
'create_landice_grid_from_generic_mpas_grid = mpas_tools.landice.create:create_from_generic_mpas_grid',
'define_landice_cull_mask = mpas_tools.landice.cull:define_cull_mask',
'interpolate_to_mpasli_grid = mpas_tools.landice.interpolate:interpolate_to_mpasli_grid',
'mark_domain_boundaries_dirichlet = mpas_tools.landice.boundary:mark_domain_boundaries_dirichlet',
]
})

0 comments on commit d943d6c

Please sign in to comment.