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

Ignore compiled InVEST models. #1765

Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 26 additions & 26 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,32 +46,32 @@ def run(self):

setup(
install_requires=_REQUIREMENTS,
ext_modules=cythonize([
Extension(
name=f'natcap.invest.{package}.{module}',
sources=[f'src/natcap/invest/{package}/{module}.pyx'],
extra_compile_args=compiler_args + compiler_and_linker_args,
extra_link_args=compiler_and_linker_args,
language='c++',
define_macros=[("NPY_NO_DEPRECATED_API", "NPY_1_7_API_VERSION")]
) for package, module, compiler_args in [
('delineateit', 'delineateit_core', []),
('recreation', 'out_of_core_quadtree', []),
# clang-14 defaults to -ffp-contract=on, which causes the
# arithmetic of A*B+C to be implemented using a contraction, which
# causes an unexpected change in the precision in some viewshed
# tests on ARM64 (mac M1). See these issues for more details:
# * https://github.com/llvm/llvm-project/issues/91824
# * https://github.com/natcap/invest/issues/1562
# * https://github.com/natcap/invest/pull/1564/files
# Using this flag on gcc and on all versions of clang should work
# as expected, with consistent results.
('scenic_quality', 'viewshed', ['-ffp-contract=off']),
('ndr', 'ndr_core', []),
('sdr', 'sdr_core', []),
('seasonal_water_yield', 'seasonal_water_yield_core', [])
]
], compiler_directives={'language_level': '3'}),
# ext_modules=cythonize([
# Extension(
# name=f'natcap.invest.{package}.{module}',
# sources=[f'src/natcap/invest/{package}/{module}.pyx'],
# extra_compile_args=compiler_args + compiler_and_linker_args,
# extra_link_args=compiler_and_linker_args,
# language='c++',
# define_macros=[("NPY_NO_DEPRECATED_API", "NPY_1_7_API_VERSION")]
# ) for package, module, compiler_args in [
# ('delineateit', 'delineateit_core', []),
# ('recreation', 'out_of_core_quadtree', []),
# # clang-14 defaults to -ffp-contract=on, which causes the
# # arithmetic of A*B+C to be implemented using a contraction, which
# # causes an unexpected change in the precision in some viewshed
# # tests on ARM64 (mac M1). See these issues for more details:
# # * https://github.com/llvm/llvm-project/issues/91824
# # * https://github.com/natcap/invest/issues/1562
# # * https://github.com/natcap/invest/pull/1564/files
# # Using this flag on gcc and on all versions of clang should work
# # as expected, with consistent results.
# ('scenic_quality', 'viewshed', ['-ffp-contract=off']),
# ('ndr', 'ndr_core', []),
# ('sdr', 'sdr_core', []),
# ('seasonal_water_yield', 'seasonal_water_yield_core', [])
# ]
# ], compiler_directives={'language_level': '3'}),
include_dirs=[numpy.get_include()],
cmdclass={
'build_py': build_py
Expand Down
3 changes: 3 additions & 0 deletions src/natcap/invest/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ def is_invest_compliant_model(module):
for _, _name, _ispkg in pkgutil.iter_modules(natcap.invest.__path__):
if _name in {'__main__', 'cli', 'ui_server'}:
continue # avoid a circular import
if _name in {'delineateit', 'ndr', 'scenic_quality', 'sdr',
'seasonal_water_yield', 'recreation'}:
continue # avoid compiled modles for devoloped of plugin feature branch
_module = importlib.import_module(f'natcap.invest.{_name}')
if _ispkg:
for _, _sub_name, _ in pkgutil.iter_modules(_module.__path__):
Expand Down
Loading