From aac3818dfb81a29d26db54ad9046ab23fe24b883 Mon Sep 17 00:00:00 2001 From: bn Date: Tue, 12 Mar 2024 11:42:05 +0100 Subject: [PATCH] Change fpoly imported module if fortran lib is present or not. --- eastereig/fpoly/__init__.py | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/eastereig/fpoly/__init__.py b/eastereig/fpoly/__init__.py index e69de29..1cb1c1d 100644 --- a/eastereig/fpoly/__init__.py +++ b/eastereig/fpoly/__init__.py @@ -0,0 +1,31 @@ +# -*- coding: utf-8 -*- + +# This file is part of eastereig, a library to locate exceptional points +# and to reconstruct eigenvalues loci. + +# Eastereig is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. + +# Eastereig is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with Eastereig. If not, see . + +""" +Select the the good polynomial module (fast fortran full python fallback version). +Neither `_fpolyval_full_py.py`, nor `_fpolyval.cpython-xxx.so` +are supposed to be imported directly. One must use the `fpoly` module. + +See README for installation details. +""" +try: + # Fortran version + from ._fpoly import polyvalnd +except ImportError: + # Python fallback version + from ._fpolyval_full_py import polyvalnd