From 1dd7d20bc25aa0b28d089a4af9a321372e782f22 Mon Sep 17 00:00:00 2001 From: Ahnaf Tahmid Chowdhury Date: Fri, 24 May 2024 23:11:21 +0600 Subject: [PATCH 1/5] remove pymoab dependency --- pyproject.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 4034efb..344e1da 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -13,7 +13,6 @@ readme = "README.md" license = {text = "MIT"} dependencies = [ "numpy", - "pymoab" ] classifiers = [ "Intended Audience :: Developers", From 667578a2ce65880042047661efcaeb409d1db36c Mon Sep 17 00:00:00 2001 From: Ahnaf Tahmid Chowdhury Date: Fri, 24 May 2024 23:41:10 +0600 Subject: [PATCH 2/5] add instructions if pymoab not found --- dagmc/dagnav.py | 38 ++++++++++++++++++++++++++++++++++++-- 1 file changed, 36 insertions(+), 2 deletions(-) diff --git a/dagmc/dagnav.py b/dagmc/dagnav.py index 7eb2719..039e80b 100644 --- a/dagmc/dagnav.py +++ b/dagmc/dagnav.py @@ -1,12 +1,46 @@ +""" +This file includes the DAGModel module which is designed to manage and +manipulate hierarchical geometric data structures used in computational +modeling and simulation, particularly in the context of Discrete Geometry. +It uses the PyMOAB library to handle geometric entities, ensuring efficient +access, manipulation, and storage of geometric data. +""" + from __future__ import annotations from abc import abstractmethod from functools import cached_property from itertools import chain from typing import Optional, Dict from warnings import warn - +import logging import numpy as np -from pymoab import core, types, rng, tag + +try: + from pymoab import core, types, rng, tag +except ImportError as e: + logging.error( + "pymoab not found. Please ensure that MOAB is installed with HDF5 and pymoab enabled.\n" + "You can follow these steps to install MOAB:\n\n" + "1. Clone the MOAB repository and checkout version 5.5.1:\n" + " git clone --depth 1 https://bitbucket.org/fathomteam/moab -b 5.5.1\n" + "2. Navigate to the MOAB directory and create a build directory:\n" + " cd moab\n" + " mkdir -p build\n" + " cd build\n" + "3. Run cmake with the appropriate options and build/install MOAB:\n" + " cmake ../ -DENABLE_HDF5=ON \\\n" + " -DHDF5_ROOT=path/to/hdf5 \\\n" + " -DBUILD_SHARED_LIBS=ON \\\n" + " -DENABLE_PYMOAB=ON \\\n" + " -DENABLE_BLASLAPACK=OFF \\\n" + " -DENABLE_FORTRAN=OFF \\\n" + " -DCMAKE_INSTALL_PREFIX=path/to/python/root/env/where/pydagmc/installed\n" + " make\n" + " make install\n\n" + "For more information, you can visit the MOAB repository: https://bitbucket.org/fathomteam/moab\n" + "and the HDF5 repository: https://github.com/HDFGroup/hdf5\n\n" + ) + raise e class DAGModel: From a4c17cccd63c2f46e5c8fb961187cdeb111354da Mon Sep 17 00:00:00 2001 From: Ahnaf Tahmid Chowdhury Date: Wed, 29 May 2024 15:45:39 +0600 Subject: [PATCH 3/5] Update dagmc/dagnav.py Co-authored-by: Patrick Shriwise --- dagmc/dagnav.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/dagmc/dagnav.py b/dagmc/dagnav.py index 039e80b..f2f319d 100644 --- a/dagmc/dagnav.py +++ b/dagmc/dagnav.py @@ -1,9 +1,7 @@ """ This file includes the DAGModel module which is designed to manage and manipulate hierarchical geometric data structures used in computational -modeling and simulation, particularly in the context of Discrete Geometry. -It uses the PyMOAB library to handle geometric entities, ensuring efficient -access, manipulation, and storage of geometric data. +modeling and simulation built upon the PyMOAB package. """ from __future__ import annotations From f9ee79a5b66345b5311b4462ecf33702625598d2 Mon Sep 17 00:00:00 2001 From: Ahnaf Tahmid Chowdhury Date: Wed, 29 May 2024 16:01:38 +0600 Subject: [PATCH 4/5] follow @pshriwise suggestion --- dagmc/dagnav.py | 33 +++++++++------------------------ 1 file changed, 9 insertions(+), 24 deletions(-) diff --git a/dagmc/dagnav.py b/dagmc/dagnav.py index f2f319d..05f11b9 100644 --- a/dagmc/dagnav.py +++ b/dagmc/dagnav.py @@ -10,35 +10,20 @@ from itertools import chain from typing import Optional, Dict from warnings import warn -import logging import numpy as np try: from pymoab import core, types, rng, tag except ImportError as e: - logging.error( - "pymoab not found. Please ensure that MOAB is installed with HDF5 and pymoab enabled.\n" - "You can follow these steps to install MOAB:\n\n" - "1. Clone the MOAB repository and checkout version 5.5.1:\n" - " git clone --depth 1 https://bitbucket.org/fathomteam/moab -b 5.5.1\n" - "2. Navigate to the MOAB directory and create a build directory:\n" - " cd moab\n" - " mkdir -p build\n" - " cd build\n" - "3. Run cmake with the appropriate options and build/install MOAB:\n" - " cmake ../ -DENABLE_HDF5=ON \\\n" - " -DHDF5_ROOT=path/to/hdf5 \\\n" - " -DBUILD_SHARED_LIBS=ON \\\n" - " -DENABLE_PYMOAB=ON \\\n" - " -DENABLE_BLASLAPACK=OFF \\\n" - " -DENABLE_FORTRAN=OFF \\\n" - " -DCMAKE_INSTALL_PREFIX=path/to/python/root/env/where/pydagmc/installed\n" - " make\n" - " make install\n\n" - "For more information, you can visit the MOAB repository: https://bitbucket.org/fathomteam/moab\n" - "and the HDF5 repository: https://github.com/HDFGroup/hdf5\n\n" - ) - raise e + msg = ''' + + \033[1m\033[91mPyMOAB package was not found.\033[0m + + \033[1mPlease install this package using the instructions found here:\033[0m + + \033[94mhttps://ftp.mcs.anl.gov/pub/fathom/moab-docs/building.html\033[0m + ''' + raise ModuleNotFoundError(msg) from e class DAGModel: From fc192820b2fe90bc818c17376034145a34f7e254 Mon Sep 17 00:00:00 2001 From: Ahnaf Tahmid Chowdhury Date: Thu, 30 May 2024 10:31:49 +0600 Subject: [PATCH 5/5] fix conflicts --- pyproject.toml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index f0ded86..d846653 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -16,14 +16,7 @@ authors = [ ] description = "A convenience interface for examining DAGMC models using PyMOAB" readme = "README.md" -<<<<<<< install-without-pymoab -license = {text = "MIT"} -dependencies = [ - "numpy", -] -======= license = { text = "MIT" } ->>>>>>> main classifiers = [ "Development Status :: 4 - Beta", "Intended Audience :: Developers",