diff --git a/src/sage/features/__init__.py b/src/sage/features/__init__.py index cb2e2a085c3..fc60ac746b7 100644 --- a/src/sage/features/__init__.py +++ b/src/sage/features/__init__.py @@ -52,6 +52,19 @@ As can be seen above, features try to produce helpful error messages. """ +# ***************************************************************************** +# Copyright (C) 2016 Julian Rüth +# 2018 Jeroen Demeyer +# 2018 Timo Kaufmann +# 2019-2022 Matthias Koeppe +# 2021 Kwankyu Lee +# +# Distributed under the terms of the GNU General Public License (GPL) +# as published by the Free Software Foundation; either version 2 of +# the License, or (at your option) any later version. +# https://www.gnu.org/licenses/ +# ***************************************************************************** + from __future__ import annotations import os diff --git a/src/sage/features/all.py b/src/sage/features/all.py index 2ec0c267b83..19eabe60126 100644 --- a/src/sage/features/all.py +++ b/src/sage/features/all.py @@ -2,6 +2,15 @@ Enumeration of all defined features """ +# ***************************************************************************** +# Copyright (C) 2021 Matthias Koeppe +# +# Distributed under the terms of the GNU General Public License (GPL) +# as published by the Free Software Foundation; either version 2 of +# the License, or (at your option) any later version. +# https://www.gnu.org/licenses/ +# ***************************************************************************** + def all_features(): r""" Return an iterable of all features. diff --git a/src/sage/features/bliss.py b/src/sage/features/bliss.py index e8efd3e8f97..aeadedfebff 100644 --- a/src/sage/features/bliss.py +++ b/src/sage/features/bliss.py @@ -1,7 +1,18 @@ -# -*- coding: utf-8 -*- r""" Features for testing the presence of ``bliss`` """ + +# ***************************************************************************** +# Copyright (C) 2016 Julian Rüth +# 2018 Jeroen Demeyer +# 2021 Matthias Koeppe +# +# Distributed under the terms of the GNU General Public License (GPL) +# as published by the Free Software Foundation; either version 2 of +# the License, or (at your option) any later version. +# https://www.gnu.org/licenses/ +# ***************************************************************************** + from . import CythonFeature, PythonModule from .join_feature import JoinFeature diff --git a/src/sage/features/cddlib.py b/src/sage/features/cddlib.py index 59a72a2120f..5badbd251c0 100644 --- a/src/sage/features/cddlib.py +++ b/src/sage/features/cddlib.py @@ -1,6 +1,16 @@ r""" Feature for testing the presence of ``cddlib`` """ + +# ***************************************************************************** +# Copyright (C) 2022 Matthias Koeppe +# +# Distributed under the terms of the GNU General Public License (GPL) +# as published by the Free Software Foundation; either version 2 of +# the License, or (at your option) any later version. +# https://www.gnu.org/licenses/ +# ***************************************************************************** + from . import Executable diff --git a/src/sage/features/csdp.py b/src/sage/features/csdp.py index e86ec415d09..9c04779558c 100644 --- a/src/sage/features/csdp.py +++ b/src/sage/features/csdp.py @@ -3,6 +3,18 @@ Feature for testing the presence of ``csdp`` """ +# ***************************************************************************** +# Copyright (C) 2016 Julian Rüth +# 2018 Jeroen Demeyer +# 2019 David Coudert +# 2021 Matthias Koeppe +# +# Distributed under the terms of the GNU General Public License (GPL) +# as published by the Free Software Foundation; either version 2 of +# the License, or (at your option) any later version. +# https://www.gnu.org/licenses/ +# ***************************************************************************** + import os import re import subprocess diff --git a/src/sage/features/cython.py b/src/sage/features/cython.py index f537843f4f4..8f03155ac2f 100644 --- a/src/sage/features/cython.py +++ b/src/sage/features/cython.py @@ -1,8 +1,16 @@ -# -*- coding: utf-8 -*- r""" Features for testing the presence of ``cython`` """ +# ***************************************************************************** +# Copyright (C) 2021 Matthias Koeppe +# +# Distributed under the terms of the GNU General Public License (GPL) +# as published by the Free Software Foundation; either version 2 of +# the License, or (at your option) any later version. +# https://www.gnu.org/licenses/ +# ***************************************************************************** + from . import CythonFeature diff --git a/src/sage/features/databases.py b/src/sage/features/databases.py index d1e77a8ff32..7fa05ca099a 100644 --- a/src/sage/features/databases.py +++ b/src/sage/features/databases.py @@ -1,8 +1,21 @@ -# -*- coding: utf-8 -*- r""" Features for testing the presence of various databases """ +# ***************************************************************************** +# Copyright (C) 2016 Julian Rüth +# 2018-2019 Jeroen Demeyer +# 2018 Timo Kaufmann +# 2020-2022 Matthias Koeppe +# 2020-2022 Sebastian Oehms +# 2021 Kwankyu Lee +# +# Distributed under the terms of the GNU General Public License (GPL) +# as published by the Free Software Foundation; either version 2 of +# the License, or (at your option) any later version. +# https://www.gnu.org/licenses/ +# ***************************************************************************** + from . import StaticFile, PythonModule from sage.env import ( diff --git a/src/sage/features/dvipng.py b/src/sage/features/dvipng.py index 44ef6c7074a..281084a6e72 100644 --- a/src/sage/features/dvipng.py +++ b/src/sage/features/dvipng.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- r""" Feature for testing the presence of ``dvipng`` """ diff --git a/src/sage/features/ffmpeg.py b/src/sage/features/ffmpeg.py index bb708478251..681af26494c 100644 --- a/src/sage/features/ffmpeg.py +++ b/src/sage/features/ffmpeg.py @@ -1,9 +1,8 @@ -# -*- coding: utf-8 -*- r""" Feature for testing the presence of ``ffmpeg`` """ # **************************************************************************** -# Copyright (C) 2018 Sebastien Labbe +# Copyright (C) 2018-2022 Sebastien Labbe # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/src/sage/features/gap.py b/src/sage/features/gap.py index 20add30c114..67c905a35c3 100644 --- a/src/sage/features/gap.py +++ b/src/sage/features/gap.py @@ -1,9 +1,18 @@ -# -*- coding: utf-8 -*- r""" Features for testing the presence of GAP packages """ +# ***************************************************************************** +# Copyright (C) 2016 Julian Rüth +# 2018 Jeroen Demeyer +# +# Distributed under the terms of the GNU General Public License (GPL) +# as published by the Free Software Foundation; either version 2 of +# the License, or (at your option) any later version. +# https://www.gnu.org/licenses/ +# ***************************************************************************** -from . import Feature, FeatureTestResult +from . import Feature, FeatureTestResult, PythonModule +from .join_feature import JoinFeature class GapPackage(Feature): @@ -48,3 +57,34 @@ def _is_present(self): else: return FeatureTestResult(self, False, reason="`{command}` evaluated to `{presence}` in GAP.".format(command=command, presence=presence)) + + +class sage__libs__gap(JoinFeature): + r""" + A :class:`sage.features.Feature` describing the presence of :mod:`sage.libs.gap` + (the library interface to GAP) and :mod:`sage.interfaces.gap` (the pexpect + interface to GAP). By design, we do not distinguish between these two, in order + to facilitate the conversion of code from the pexpect interface to the library + interface. + + EXAMPLES:: + + sage: from sage.features.gap import sage__libs__gap + sage: sage__libs__gap().is_present() # optional - sage.libs.gap + FeatureTestResult('sage.libs.gap', True) + """ + def __init__(self): + r""" + TESTS:: + + sage: from sage.features.gap import sage__libs__gap + sage: isinstance(sage__libs__gap(), sage__libs__gap) + True + """ + JoinFeature.__init__(self, 'sage.libs.gap', + [PythonModule('sage.libs.gap.libgap'), + PythonModule('sage.interfaces.gap')]) + + +def all_features(): + return [sage__libs__gap()] diff --git a/src/sage/features/gfan.py b/src/sage/features/gfan.py index 6551ca5340c..d9a74db9e1b 100644 --- a/src/sage/features/gfan.py +++ b/src/sage/features/gfan.py @@ -2,6 +2,15 @@ Features for testing the presence of ``gfan`` """ +# ***************************************************************************** +# Copyright (C) 2022 Matthias Koeppe +# +# Distributed under the terms of the GNU General Public License (GPL) +# as published by the Free Software Foundation; either version 2 of +# the License, or (at your option) any later version. +# https://www.gnu.org/licenses/ +# ***************************************************************************** + from . import Executable diff --git a/src/sage/features/graph_generators.py b/src/sage/features/graph_generators.py index 0ecd63bad76..3d484c59f6b 100644 --- a/src/sage/features/graph_generators.py +++ b/src/sage/features/graph_generators.py @@ -1,8 +1,20 @@ -# -*- coding: utf-8 -*- r""" Features for testing the presence of various graph generator programs """ +# ***************************************************************************** +# Copyright (C) 2016 Julian Rüth +# 2018 Jeroen Demeyer +# 2019 Frédéric Chapoton +# 2021 Matthias Koeppe +# 2021 Kwankyu Lee +# +# Distributed under the terms of the GNU General Public License (GPL) +# as published by the Free Software Foundation; either version 2 of +# the License, or (at your option) any later version. +# https://www.gnu.org/licenses/ +# ***************************************************************************** + import os import subprocess diff --git a/src/sage/features/graphviz.py b/src/sage/features/graphviz.py index 0a0c8ba88e9..2105eda9d8c 100644 --- a/src/sage/features/graphviz.py +++ b/src/sage/features/graphviz.py @@ -1,9 +1,10 @@ -# -*- coding: utf-8 -*- r""" Features for testing the presence of ``graphviz`` """ + # **************************************************************************** # Copyright (C) 2018 Sebastien Labbe +# 2021 Matthias Koeppe # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -11,6 +12,7 @@ # (at your option) any later version. # https://www.gnu.org/licenses/ # **************************************************************************** + from . import Executable from .join_feature import JoinFeature diff --git a/src/sage/features/igraph.py b/src/sage/features/igraph.py index 04ac4efbb54..6bb83294a95 100644 --- a/src/sage/features/igraph.py +++ b/src/sage/features/igraph.py @@ -1,6 +1,17 @@ r""" Check for igraph """ + +# **************************************************************************** +# Copyright (C) 2021 Matthias Koeppe +# +# This program 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 2 of the License, or +# (at your option) any later version. +# https://www.gnu.org/licenses/ +# **************************************************************************** + from . import PythonModule from .join_feature import JoinFeature diff --git a/src/sage/features/imagemagick.py b/src/sage/features/imagemagick.py index 59e35cb5a7a..b7aa3aeb9a2 100644 --- a/src/sage/features/imagemagick.py +++ b/src/sage/features/imagemagick.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- r""" Feature for testing the presence of ``imagemagick`` @@ -7,8 +6,9 @@ ``identify``, ``composite``, ``montage``, ``compare``, etc. could be also checked in this module. """ + # **************************************************************************** -# Copyright (C) 2018 Sebastien Labbe +# Copyright (C) 2018-2022 Sebastien Labbe # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/src/sage/features/interfaces.py b/src/sage/features/interfaces.py index b77c2cc4f88..e31e7b72d61 100644 --- a/src/sage/features/interfaces.py +++ b/src/sage/features/interfaces.py @@ -1,6 +1,17 @@ r""" Features for testing whether interpreter interfaces are functional """ + +# **************************************************************************** +# Copyright (C) 2021 Matthias Koeppe +# +# This program 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 2 of the License, or +# (at your option) any later version. +# https://www.gnu.org/licenses/ +# **************************************************************************** + import importlib from . import Feature, FeatureTestResult, PythonModule diff --git a/src/sage/features/internet.py b/src/sage/features/internet.py index 6e800120828..f1eb000fe92 100644 --- a/src/sage/features/internet.py +++ b/src/sage/features/internet.py @@ -2,6 +2,16 @@ Feature for testing if the Internet is available """ +# **************************************************************************** +# Copyright (C) 2021 Matthias Koeppe +# +# This program 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 2 of the License, or +# (at your option) any later version. +# https://www.gnu.org/licenses/ +# **************************************************************************** + from . import Feature, FeatureTestResult diff --git a/src/sage/features/join_feature.py b/src/sage/features/join_feature.py index 94830eead1e..d02ad669833 100644 --- a/src/sage/features/join_feature.py +++ b/src/sage/features/join_feature.py @@ -2,6 +2,17 @@ Join features """ +# **************************************************************************** +# Copyright (C) 2021-2022 Matthias Koeppe +# 2021-2022 Kwankyu Lee +# +# This program 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 2 of the License, or +# (at your option) any later version. +# https://www.gnu.org/licenses/ +# **************************************************************************** + from . import Feature, FeatureTestResult diff --git a/src/sage/features/kenzo.py b/src/sage/features/kenzo.py index df2e658e975..655602427b8 100644 --- a/src/sage/features/kenzo.py +++ b/src/sage/features/kenzo.py @@ -1,8 +1,20 @@ -# -*- coding: utf-8 -*- r""" Feature for testing the presence of ``kenzo`` """ +# **************************************************************************** +# Copyright (C) 2020 Travis Scrimshaw +# 2021 Matthias Koeppe +# 2021 Michael Orlitzky +# +# This program 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 2 of the License, or +# (at your option) any later version. +# https://www.gnu.org/licenses/ +# **************************************************************************** + + from . import Feature, FeatureTestResult class Kenzo(Feature): diff --git a/src/sage/features/latex.py b/src/sage/features/latex.py index 02bcb57a0ca..1b01db39f67 100644 --- a/src/sage/features/latex.py +++ b/src/sage/features/latex.py @@ -1,9 +1,12 @@ -# -*- coding: utf-8 -*- r""" Features for testing the presence of ``latex`` and equivalent programs """ + # **************************************************************************** # Copyright (C) 2021 Sebastien Labbe +# 2021 Matthias Koeppe +# 2022 Kwankyu Lee +# 2022 Sebastian Oehms # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/src/sage/features/latte.py b/src/sage/features/latte.py index 6202152501f..e88752bd561 100644 --- a/src/sage/features/latte.py +++ b/src/sage/features/latte.py @@ -1,7 +1,20 @@ -# -*- coding: utf-8 -*- r""" Features for testing the presence of ``latte_int`` """ + +# **************************************************************************** +# Copyright (C) 2018 Vincent Delecroix +# 2019 Frédéric Chapoton +# 2021 Matthias Koeppe +# 2021 Kwankyu Lee +# +# This program 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 2 of the License, or +# (at your option) any later version. +# https://www.gnu.org/licenses/ +# **************************************************************************** + from . import Executable from .join_feature import JoinFeature diff --git a/src/sage/features/lrs.py b/src/sage/features/lrs.py index d7b15fbcdd6..501d1d371e7 100644 --- a/src/sage/features/lrs.py +++ b/src/sage/features/lrs.py @@ -3,6 +3,19 @@ Feature for testing the presence of ``lrslib`` """ +# ***************************************************************************** +# Copyright (C) 2016 Julian Rüth +# 2018 Jeroen Demeyer +# 2021-2022 Matthias Koeppe +# 2021 Kwankyu Lee +# 2022 Sébastien Labbé +# +# Distributed under the terms of the GNU General Public License (GPL) +# as published by the Free Software Foundation; either version 2 of +# the License, or (at your option) any later version. +# https://www.gnu.org/licenses/ +# ***************************************************************************** + import subprocess from . import Executable, FeatureTestResult diff --git a/src/sage/features/mcqd.py b/src/sage/features/mcqd.py index 131b175aabc..faf7ace441d 100644 --- a/src/sage/features/mcqd.py +++ b/src/sage/features/mcqd.py @@ -2,6 +2,15 @@ Features for testing the presence of ``mcqd`` """ +# ***************************************************************************** +# Copyright (C) 2021 Matthias Koeppe +# +# Distributed under the terms of the GNU General Public License (GPL) +# as published by the Free Software Foundation; either version 2 of +# the License, or (at your option) any later version. +# https://www.gnu.org/licenses/ +# ***************************************************************************** + from . import PythonModule from .join_feature import JoinFeature diff --git a/src/sage/features/meataxe.py b/src/sage/features/meataxe.py index d3f7fce200e..78de1bdfe03 100644 --- a/src/sage/features/meataxe.py +++ b/src/sage/features/meataxe.py @@ -2,6 +2,17 @@ Feature for testing the presence of ``meataxe`` """ +# ***************************************************************************** +# Copyright (C) 2021 Matthias Koeppe +# 2021 Kwankyu Lee +# +# Distributed under the terms of the GNU General Public License (GPL) +# as published by the Free Software Foundation; either version 2 of +# the License, or (at your option) any later version. +# https://www.gnu.org/licenses/ +# ***************************************************************************** + + from . import PythonModule from .join_feature import JoinFeature diff --git a/src/sage/features/mip_backends.py b/src/sage/features/mip_backends.py index 477d88efabf..d276e25abe8 100644 --- a/src/sage/features/mip_backends.py +++ b/src/sage/features/mip_backends.py @@ -2,6 +2,16 @@ Features for testing the presence of :class:`MixedIntegerLinearProgram` backends """ +# ***************************************************************************** +# Copyright (C) 2021-2022 Matthias Koeppe +# 2021 Kwankyu Lee +# +# Distributed under the terms of the GNU General Public License (GPL) +# as published by the Free Software Foundation; either version 2 of +# the License, or (at your option) any later version. +# https://www.gnu.org/licenses/ +# ***************************************************************************** + from . import Feature, PythonModule, FeatureTestResult from .join_feature import JoinFeature diff --git a/src/sage/features/msolve.py b/src/sage/features/msolve.py index a7c7d5441b7..557632ff500 100644 --- a/src/sage/features/msolve.py +++ b/src/sage/features/msolve.py @@ -9,6 +9,15 @@ - :mod:`sage.rings.polynomial.msolve` """ +# ***************************************************************************** +# Copyright (C) 2022 Marc Mezzarobba +# +# Distributed under the terms of the GNU General Public License (GPL) +# as published by the Free Software Foundation; either version 2 of +# the License, or (at your option) any later version. +# https://www.gnu.org/licenses/ +# ***************************************************************************** + import subprocess from . import Executable from . import FeatureTestResult diff --git a/src/sage/features/nauty.py b/src/sage/features/nauty.py index 86683eb29df..f3df59f4a9c 100644 --- a/src/sage/features/nauty.py +++ b/src/sage/features/nauty.py @@ -2,6 +2,15 @@ Features for testing the presence of nauty executables """ +# ***************************************************************************** +# Copyright (C) 2022 Matthias Koeppe +# +# Distributed under the terms of the GNU General Public License (GPL) +# as published by the Free Software Foundation; either version 2 of +# the License, or (at your option) any later version. +# https://www.gnu.org/licenses/ +# ***************************************************************************** + from sage.env import SAGE_NAUTY_BINS_PREFIX from . import Executable diff --git a/src/sage/features/normaliz.py b/src/sage/features/normaliz.py index 5c3ab4255f3..acf8c9242c1 100644 --- a/src/sage/features/normaliz.py +++ b/src/sage/features/normaliz.py @@ -1,6 +1,16 @@ r""" Feature for testing the presence of ``pynormaliz`` """ + +# ***************************************************************************** +# Copyright (C) 2021 Matthias Koeppe +# +# Distributed under the terms of the GNU General Public License (GPL) +# as published by the Free Software Foundation; either version 2 of +# the License, or (at your option) any later version. +# https://www.gnu.org/licenses/ +# ***************************************************************************** + from . import PythonModule from .join_feature import JoinFeature diff --git a/src/sage/features/pandoc.py b/src/sage/features/pandoc.py index 0a2bbcdacdb..a00a2b6f8e4 100644 --- a/src/sage/features/pandoc.py +++ b/src/sage/features/pandoc.py @@ -4,6 +4,7 @@ """ # **************************************************************************** # Copyright (C) 2018 Thierry Monteil +# 2021 Matthias Koeppe # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/src/sage/features/pdf2svg.py b/src/sage/features/pdf2svg.py index 9de3fb3cfd6..2b60574fe85 100644 --- a/src/sage/features/pdf2svg.py +++ b/src/sage/features/pdf2svg.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- r""" Feature for testing the presence of ``pdf2svg`` """ diff --git a/src/sage/features/phitigra.py b/src/sage/features/phitigra.py index f792d7b47cd..60ef8f46dde 100644 --- a/src/sage/features/phitigra.py +++ b/src/sage/features/phitigra.py @@ -1,6 +1,16 @@ r""" Check for phitigra """ + +# ***************************************************************************** +# Copyright (C) 2022 Jean-Florent Raymond +# +# Distributed under the terms of the GNU General Public License (GPL) +# as published by the Free Software Foundation; either version 2 of +# the License, or (at your option) any later version. +# https://www.gnu.org/licenses/ +# ***************************************************************************** + from . import PythonModule diff --git a/src/sage/features/pkg_systems.py b/src/sage/features/pkg_systems.py index 5e31ec9f66d..334f8378050 100644 --- a/src/sage/features/pkg_systems.py +++ b/src/sage/features/pkg_systems.py @@ -1,6 +1,16 @@ r""" Features for testing the presence of package systems """ + +# ***************************************************************************** +# Copyright (C) 2021-2022 Matthias Koeppe +# +# Distributed under the terms of the GNU General Public License (GPL) +# as published by the Free Software Foundation; either version 2 of +# the License, or (at your option) any later version. +# https://www.gnu.org/licenses/ +# ***************************************************************************** + from . import Feature diff --git a/src/sage/features/polymake.py b/src/sage/features/polymake.py index 579951c047f..6168c6c9978 100644 --- a/src/sage/features/polymake.py +++ b/src/sage/features/polymake.py @@ -1,6 +1,16 @@ r""" Feature for testing the presence of the Python interface to polymake """ + +# ***************************************************************************** +# Copyright (C) 2021 Matthias Koeppe +# +# Distributed under the terms of the GNU General Public License (GPL) +# as published by the Free Software Foundation; either version 2 of +# the License, or (at your option) any later version. +# https://www.gnu.org/licenses/ +# ***************************************************************************** + from . import PythonModule from .join_feature import JoinFeature diff --git a/src/sage/features/poppler.py b/src/sage/features/poppler.py index 1b0379bc0d2..b8f8586e7f5 100644 --- a/src/sage/features/poppler.py +++ b/src/sage/features/poppler.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- r""" Check for poppler features diff --git a/src/sage/features/rubiks.py b/src/sage/features/rubiks.py index b418c1571cb..b9bd2f126f7 100644 --- a/src/sage/features/rubiks.py +++ b/src/sage/features/rubiks.py @@ -1,14 +1,17 @@ -# -*- coding: utf-8 -*- r""" Features for testing the presence of ``rubiks`` """ # **************************************************************************** +# Copyright (C) 2020 John H. Palmieri +# 2021-2022 Matthias Koeppe +# # This program 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 2 of the License, or # (at your option) any later version. # https://www.gnu.org/licenses/ # **************************************************************************** + from sage.env import RUBIKS_BINS_PREFIX from . import Executable diff --git a/src/sage/features/sagemath.py b/src/sage/features/sagemath.py index 3cb66162f07..fd090764b44 100644 --- a/src/sage/features/sagemath.py +++ b/src/sage/features/sagemath.py @@ -1,6 +1,17 @@ r""" Features for testing the presence of Python modules in the Sage library """ + +# ***************************************************************************** +# Copyright (C) 2021 Matthias Koeppe +# 2021 Kwankyu Lee +# +# Distributed under the terms of the GNU General Public License (GPL) +# as published by the Free Software Foundation; either version 2 of +# the License, or (at your option) any later version. +# https://www.gnu.org/licenses/ +# ***************************************************************************** + from . import PythonModule, StaticFile from .join_feature import JoinFeature diff --git a/src/sage/features/singular.py b/src/sage/features/singular.py index 610e195c641..c3bd3b6be03 100644 --- a/src/sage/features/singular.py +++ b/src/sage/features/singular.py @@ -1,7 +1,18 @@ r""" Features for testing the presence of Singular """ -from . import Executable + +# ***************************************************************************** +# Copyright (C) 2022-2023 Matthias Koeppe +# +# Distributed under the terms of the GNU General Public License (GPL) +# as published by the Free Software Foundation; either version 2 of +# the License, or (at your option) any later version. +# https://www.gnu.org/licenses/ +# ***************************************************************************** + +from . import Executable, PythonModule +from .join_feature import JoinFeature from sage.env import SINGULAR_BIN @@ -25,3 +36,35 @@ def __init__(self): """ Executable.__init__(self, "singular", SINGULAR_BIN, spkg='singular') + + +class sage__libs__singular(JoinFeature): + r""" + A :class:`sage.features.Feature` describing the presence of :mod:`sage.libs.singular` + (the library interface to Singular) and :mod:`sage.interfaces.singular` (the pexpect + interface to Singular). By design, we do not distinguish between these two, in order + to facilitate the conversion of code from the pexpect interface to the library + interface. + + EXAMPLES:: + + sage: from sage.features.singular import sage__libs__singular + sage: sage__libs__singular().is_present() # optional - sage.libs.singular + FeatureTestResult('sage.libs.singular', True) + """ + def __init__(self): + r""" + TESTS:: + + sage: from sage.features.singular import sage__libs__singular + sage: isinstance(sage__libs__singular(), sage__libs__singular) + True + """ + JoinFeature.__init__(self, 'sage.libs.singular', + [PythonModule('sage.libs.singular.singular'), + PythonModule('sage.interfaces.singular')]) + + +def all_features(): + return [Singular(), + sage__libs__singular()] diff --git a/src/sage/features/sphinx.py b/src/sage/features/sphinx.py index d29de3f34f4..44283765fd1 100644 --- a/src/sage/features/sphinx.py +++ b/src/sage/features/sphinx.py @@ -1,6 +1,16 @@ r""" Check for Sphinx """ + +# ***************************************************************************** +# Copyright (C) 2021 Matthias Koeppe +# +# Distributed under the terms of the GNU General Public License (GPL) +# as published by the Free Software Foundation; either version 2 of +# the License, or (at your option) any later version. +# https://www.gnu.org/licenses/ +# ***************************************************************************** + from . import PythonModule diff --git a/src/sage/features/standard.py b/src/sage/features/standard.py new file mode 100644 index 00000000000..f48f47f2614 --- /dev/null +++ b/src/sage/features/standard.py @@ -0,0 +1,35 @@ +r""" +Check for various standard packages (for modularized distributions) + +These features are provided by standard packages in the Sage distribution. +""" + +# ***************************************************************************** +# Copyright (C) 2023 Matthias Koeppe +# +# Distributed under the terms of the GNU General Public License (GPL) +# as published by the Free Software Foundation; either version 2 of +# the License, or (at your option) any later version. +# https://www.gnu.org/licenses/ +# ***************************************************************************** + +from . import PythonModule +from .join_feature import JoinFeature + + +def all_features(): + return [PythonModule('cvxopt', spkg='cvxopt'), + PythonModule('fpylll', spkg='fpylll'), + JoinFeature('ipython', (PythonModule('IPython'),), spkg='ipython'), + JoinFeature('lrcalc_python', (PythonModule('lrcalc'),), spkg='lrcalc_python'), + PythonModule('mpmath', spkg='mpmath'), + PythonModule('networkx', spkg='networkx'), + PythonModule('numpy', spkg='numpy'), + PythonModule('pexpect', spkg='pexpect'), + JoinFeature('pillow', (PythonModule('PIL'),), spkg='pillow'), + JoinFeature('pplpy', (PythonModule('ppl'),), spkg='pplpy'), + PythonModule('primecountpy', spkg='primecountpy'), + PythonModule('ptyprocess', spkg='ptyprocess'), + PythonModule('requests', spkg='requests'), + PythonModule('scipy', spkg='scipy'), + PythonModule('sympy', spkg='sympy')] diff --git a/src/sage/features/tdlib.py b/src/sage/features/tdlib.py index ff38f6e23a5..afde40f7de7 100644 --- a/src/sage/features/tdlib.py +++ b/src/sage/features/tdlib.py @@ -2,6 +2,16 @@ Features for testing the presence of ``tdlib`` """ +# ***************************************************************************** +# Copyright (C) 2021 Matthias Koeppe +# 2021 Kwankyu Lee +# +# Distributed under the terms of the GNU General Public License (GPL) +# as published by the Free Software Foundation; either version 2 of +# the License, or (at your option) any later version. +# https://www.gnu.org/licenses/ +# ***************************************************************************** + from . import PythonModule from .join_feature import JoinFeature diff --git a/src/sage/geometry/riemannian_manifolds/parametrized_surface3d.py b/src/sage/geometry/riemannian_manifolds/parametrized_surface3d.py index 55d5609a861..7428aaff5e0 100644 --- a/src/sage/geometry/riemannian_manifolds/parametrized_surface3d.py +++ b/src/sage/geometry/riemannian_manifolds/parametrized_surface3d.py @@ -244,22 +244,25 @@ class ParametrizedSurface3D(SageObject): sage: u2min, u2max = 0, 6.28 sage: u1num, u2num = 10, 20 sage: # make the arguments array - sage: from numpy import linspace - sage: u1_array = linspace(u1min, u1max, u1num) - sage: u2_array = linspace(u2min, u2max, u2num) - sage: u_array = [ (uu1,uu2) for uu1 in u1_array for uu2 in u2_array] + sage: from numpy import linspace # optional - numpy + sage: u1_array = linspace(u1min, u1max, u1num) # optional - numpy + sage: u2_array = linspace(u2min, u2max, u2num) # optional - numpy + sage: u_array = [(uu1,uu2) for uu1 in u1_array for uu2 in u2_array] # optional - numpy sage: # Find the gaussian curvature - sage: K(u1,u2) = ellipsoid.gauss_curvature() - sage: # Make array of K values - sage: K_array = [K(uu[0],uu[1]) for uu in u_array] + sage: K(u1,u2) = ellipsoid.gauss_curvature() # optional - numpy + sage: # Make array of K values # optional - numpy + sage: K_array = [K(uu[0],uu[1]) for uu in u_array] # optional - numpy sage: # Find minimum and max of the Gauss curvature - sage: K_max = max(K_array) - sage: K_min = min(K_array) + sage: K_max = max(K_array) # optional - numpy + sage: K_min = min(K_array) # optional - numpy sage: # Make the array of color coefficients - sage: cc_array = [ (ccc - K_min)/(K_max - K_min) for ccc in K_array ] - sage: points_array = [ellipsoid_equation(u_array[counter][0],u_array[counter][1]) for counter in range(0,len(u_array)) ] - sage: curvature_ellipsoid_plot = sum( point([xx for xx in points_array[counter]],color=hue(cc_array[counter]/2)) for counter in range(0,len(u_array)) ) - sage: curvature_ellipsoid_plot.show(aspect_ratio=1) + sage: cc_array = [(ccc - K_min)/(K_max - K_min) for ccc in K_array] # optional - numpy + sage: points_array = [ellipsoid_equation(u_array[counter][0],u_array[counter][1]) + ....: for counter in range(0,len(u_array))] + sage: curvature_ellipsoid_plot = sum(point([xx for xx in points_array[counter]], # optional - numpy sage.plot + ....: color=hue(cc_array[counter]/2)) + ....: for counter in range(0,len(u_array))) + sage: curvature_ellipsoid_plot.show(aspect_ratio=1) # optional - numpy sage.plot We can find the principal curvatures and principal directions of the elliptic paraboloid:: diff --git a/src/sage/manifolds/subsets/pullback.py b/src/sage/manifolds/subsets/pullback.py index 2ed36070642..46584303772 100644 --- a/src/sage/manifolds/subsets/pullback.py +++ b/src/sage/manifolds/subsets/pullback.py @@ -261,23 +261,23 @@ def _is_open(codomain_subset): PPL polyhedra and not-necessarily-closed polyhedra:: - sage: from ppl import Variable, C_Polyhedron, NNC_Polyhedron, Constraint_System - sage: u = Variable(0) - sage: v = Variable(1) - sage: CS = Constraint_System() - sage: CS.insert(0 < u) - sage: CS.insert(u < 1) - sage: CS.insert(0 < v) - sage: CS.insert(v < 1) - sage: CS.insert(u + v <= 3) # redundant inequality - sage: P = NNC_Polyhedron(CS); P + sage: from ppl import Variable, C_Polyhedron, NNC_Polyhedron, Constraint_System # optional - pplpy + sage: u = Variable(0) # optional - pplpy + sage: v = Variable(1) # optional - pplpy + sage: CS = Constraint_System() # optional - pplpy + sage: CS.insert(0 < u) # optional - pplpy + sage: CS.insert(u < 1) # optional - pplpy + sage: CS.insert(0 < v) # optional - pplpy + sage: CS.insert(v < 1) # optional - pplpy + sage: CS.insert(u + v <= 3) # redundant inequality # optional - pplpy + sage: P = NNC_Polyhedron(CS); P # optional - pplpy A 2-dimensional polyhedron in QQ^2 defined as the convex hull of 1 point, 4 closure_points - sage: ManifoldSubsetPullback._is_open(P) + sage: ManifoldSubsetPullback._is_open(P) # optional - pplpy True - sage: CS.insert(u + v <= 1) - sage: T = NNC_Polyhedron(CS); T + sage: CS.insert(u + v <= 1) # optional - pplpy + sage: T = NNC_Polyhedron(CS); T # optional - pplpy A 2-dimensional polyhedron in QQ^2 defined as the convex hull of 1 point, 3 closure_points - sage: ManifoldSubsetPullback._is_open(T) + sage: ManifoldSubsetPullback._is_open(T) # optional - pplpy False """ diff --git a/src/sage/tensor/modules/reflexive_module.py b/src/sage/tensor/modules/reflexive_module.py index f9ca8f6ab71..504b45e05b6 100644 --- a/src/sage/tensor/modules/reflexive_module.py +++ b/src/sage/tensor/modules/reflexive_module.py @@ -256,9 +256,9 @@ def base_module(self): sage: M.base_module() is M True - sage: M = Manifold(2, 'M') - sage: XM = M.vector_field_module() - sage: XM.base_module() is XM + sage: M = Manifold(2, 'M') # optional - sage.symbolic + sage: XM = M.vector_field_module() # optional - sage.symbolic + sage: XM.base_module() is XM # optional - sage.symbolic True """ return self @@ -273,9 +273,9 @@ def tensor_type(self): sage: M.tensor_type() (1, 0) - sage: M = Manifold(2, 'M') - sage: XM = M.vector_field_module() - sage: XM.tensor_type() + sage: M = Manifold(2, 'M') # optional - sage.symbolic + sage: XM = M.vector_field_module() # optional - sage.symbolic + sage: XM.tensor_type() # optional - sage.symbolic (1, 0) """ return (1, 0)