Skip to content

Commit

Permalink
Remove imports from gsl.all
Browse files Browse the repository at this point in the history
I had troubles with importing `gsl` (on Windows) and tried to fix it by changing imports from `gsl.all` to more specific imports. Turns out the real problem was actually wrong `pkg-config` entry; but I thought these more specific imports might be helpful anyway and should (slightly) reduce the size of the built library.
  • Loading branch information
tobiasdiez committed Oct 28, 2024
1 parent 1b3f398 commit c287347
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 10 deletions.
5 changes: 4 additions & 1 deletion src/sage/calculus/integration.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@ from cysignals.signals cimport sig_on, sig_off
from memory_allocator cimport MemoryAllocator

from sage.rings.real_double import RDF
from sage.libs.gsl.all cimport *
from sage.libs.gsl.errno cimport gsl_set_error_handler_off
from sage.libs.gsl.integration cimport *
from sage.libs.gsl.monte cimport *
from sage.libs.gsl.rng cimport *
from sage.misc.sageinspect import sage_getargspec
from sage.ext.interpreters.wrapper_rdf cimport Wrapper_rdf
from sage.ext.fast_callable import fast_callable
Expand Down
3 changes: 2 additions & 1 deletion src/sage/calculus/ode.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ from cysignals.memory cimport sig_malloc, sig_free
from cysignals.signals cimport sig_on, sig_off

from sage.misc.sageinspect import sage_getargspec
from sage.libs.gsl.all cimport *
from sage.libs.gsl.types cimport *
from sage.libs.gsl.odeiv cimport *
import sage.calculus.interpolation


Expand Down
3 changes: 2 additions & 1 deletion src/sage/probability/probability_distribution.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ REFERENCES:
# ****************************************************************************
from cysignals.memory cimport sig_malloc, sig_free

from sage.libs.gsl.all cimport *
from sage.libs.gsl.rng cimport *
from sage.libs.gsl.random cimport *
import sage.misc.prandom as random
import sage.rings.real_double
from sage.modules.free_module_element import vector
Expand Down
1 change: 0 additions & 1 deletion src/sage/rings/complex_mpfr.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ from sage.rings.integer cimport Integer

from sage.rings.complex_double cimport ComplexDoubleElement
from sage.rings.real_mpfr cimport RealNumber
from sage.libs.gsl.complex cimport *

from sage.libs.mpmath.utils cimport mpfr_to_mpfval
from sage.rings.integer_ring import ZZ
Expand Down
6 changes: 2 additions & 4 deletions src/sage/rings/number_field/number_field_morphisms.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,14 @@ fields (generally `\RR` or `\CC`).
# https://www.gnu.org/licenses/
# ****************************************************************************

import sage.rings.complex_double

from sage.structure.element cimport Element
from sage.categories.morphism cimport Morphism
from sage.categories.map cimport Map
from sage.categories.pushout import pushout

from sage.rings.complex_double import CDF
from sage.rings.real_lazy import RLF, CLF, LazyField, LazyAlgebraic


cdef class NumberFieldEmbedding(Morphism):

cdef _gen_image
Expand Down Expand Up @@ -254,7 +252,7 @@ cdef class EmbeddedNumberFieldMorphism(NumberFieldEmbedding):
candidate_ambient_fields.append(ambient_field.algebraic_closure())
except NotImplementedError:
pass
candidate_ambient_fields.append(sage.rings.complex_double.CDF)
candidate_ambient_fields.append(CDF)
else:
candidate_ambient_fields = [ambient_field]

Expand Down
11 changes: 10 additions & 1 deletion src/sage/rings/real_double_element_gsl.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,16 @@ from cysignals.signals cimport sig_on, sig_off

from sage.arith.constants cimport *

from sage.libs.gsl.all cimport *
from sage.libs.gsl.errno cimport gsl_set_error_handler_off
from sage.libs.gsl.math cimport *
from sage.libs.gsl.exp cimport *
from sage.libs.gsl.log cimport gsl_sf_log
from sage.libs.gsl.trig cimport *
from sage.libs.gsl.dilog cimport gsl_sf_dilog
from sage.libs.gsl.gamma cimport gsl_sf_fact, gsl_sf_gamma
from sage.libs.gsl.zeta cimport gsl_sf_zeta
from sage.libs.gsl.erf cimport gsl_sf_erf


gsl_set_error_handler_off()

Expand Down
1 change: 0 additions & 1 deletion src/sage/symbolic/pynac_impl.pxi
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ from sage.arith.functions import lcm
from sage.cpython.string cimport str_to_bytes, char_to_str
from sage.ext.stdsage cimport PY_NEW
from sage.libs.gmp.all cimport *
from sage.libs.gsl.types cimport *
from sage.libs.gsl.complex cimport *
from sage.libs.gsl.gamma cimport gsl_sf_lngamma_complex_e
from sage.libs.mpmath import utils as mpmath_utils
Expand Down

0 comments on commit c287347

Please sign in to comment.