Skip to content

Commit 5585f13

Browse files
LoadPackage("pkg") -> LoadPackageAndExposeGlobals("pkg",Main,all_globals=true)
1 parent 36684ba commit 5585f13

File tree

4 files changed

+15
-9
lines changed

4 files changed

+15
-9
lines changed

Project.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "HomalgProject"
22
uuid = "50bd374c-87b5-11e9-015a-2febe71398bd"
33
authors = ["Mohamed Barakat <[email protected]>"]
4-
version = "0.3.1"
4+
version = "0.3.2"
55

66
[deps]
77
GAP = "c863536a-3901-11e9-33e7-d5cd0df7b904"

docs/src/examples.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ The following examples tests the functionality of the software projects
1010
DocTestSetup = quote
1111
using HomalgProject
1212
GAP.Globals.SizeScreen( GAP.julia_to_gap( [ 4096 ] ) )
13-
LoadPackageAndExposeGlobals( "GradedModules", Main, all_globals = true )
14-
LoadPackageAndExposeGlobals( "GradedModulePresentationsForCAP", Main, all_globals = true )
13+
LoadPackage( "GradedModules" )
14+
LoadPackage( "GradedModulePresentationsForCAP" )
1515
GAP.Globals.HOMALG_IO.show_banners = false
1616
HomalgFieldOfRationalsInSingular = GAP.Globals.HomalgFieldOfRationalsInSingular
1717
LeftPresentation = GAP.Globals.LeftPresentation
@@ -47,7 +47,7 @@ end
4747
```jldoctest
4848
julia> using HomalgProject
4949
50-
julia> LoadPackageAndExposeGlobals( "GradedModules", Main, all_globals = true )
50+
julia> LoadPackage( "GradedModules" )
5151
5252
julia> ℚ = HomalgFieldOfRationalsInSingular( )
5353
GAP: Q
@@ -264,7 +264,7 @@ currently represented by the above matrix
264264
```jldoctest
265265
julia> using HomalgProject
266266
267-
julia> LoadPackageAndExposeGlobals( "GradedModulePresentationsForCAP", Main, all_globals = true )
267+
julia> LoadPackage( "GradedModulePresentationsForCAP" )
268268
269269
julia> ℚ = HomalgFieldOfRationalsInSingular( )
270270
GAP: Q

src/HomalgProject.jl

+9-3
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,12 @@ import Markdown
8080
Base.:*(x::GAP.GapObj,y::String) = x*GAP.julia_to_gap(y)
8181
Base.getindex(x::GAP.GapObj,y::String) = GAP.Globals.ELM_LIST(x,GAP.julia_to_gap(y))
8282

83+
function LoadPackage( pkgname::String )
84+
LoadPackageAndExposeGlobals( pkgname, Main, all_globals = true )
85+
end
86+
87+
export LoadPackage
88+
8389
function HomalgMatrix( M::String, m::Int64, n::Int64, R::GAP.GapObj )
8490
return GAP.Globals.HomalgMatrix( GAP.julia_to_gap( M ), m, n, R )
8591
end
@@ -95,7 +101,7 @@ function UseExternalSingular( bool::Bool )
95101

96102
if bool == false
97103
## LoadPackage( "RingsForHomalg" ) ## needed by the variable HOMALG_IO_Singular below
98-
LoadPackageAndExposeGlobals( "RingsForHomalg", Main, all_globals = true )
104+
LoadPackage( "RingsForHomalg" )
99105
## Read( "LaunchCAS_JSingularInterpreterForHomalg.g" )
100106
path = GAP.julia_to_gap(joinpath(HOMALG_PROJECT_PATH,"src","LaunchCAS_JSingularInterpreterForHomalg.g"))
101107
GAP.Globals.Read(path)
@@ -113,10 +119,10 @@ function UseExternalSingular( bool::Bool )
113119
CompileGapPackage( "io", print_available = false )
114120

115121
## LoadPackage( "IO_ForHomalg" ) ## needed when reading LaunchCAS_IO_ForHomalg.g below
116-
LoadPackageAndExposeGlobals( "IO_ForHomalg", Main, all_globals = true )
122+
LoadPackage( "IO_ForHomalg" )
117123

118124
## LoadPackage( "RingsForHomalg" ) ## needed by the variable HOMALG_IO_Singular below
119-
LoadPackageAndExposeGlobals( "RingsForHomalg", Main, all_globals = true )
125+
LoadPackage( "RingsForHomalg" )
120126

121127
## add ~/.julia/.../Singular/deps/usr/lib/ to LD_LIBRARY_PATH and DYLD_LIBRARY_PATH
122128
lib = [ "LD_LIBRARY_PATH=" * lib * ":\$LD_LIBRARY_PATH", "DYLD_LIBRARY_PATH=" * lib * ":\$DYLD_LIBRARY_PATH" ]

test/runtests.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ using Documenter
1111
@test RemovePackageFromHomalgProject( "HomalgProject.jl" )
1212
@test ! RemovePackageFromHomalgProject( "HomalgProject.jl" )
1313
@test UseExternalSingular( false )
14-
LoadPackageAndExposeGlobals( "GradedModules", Main, all_globals = true )
14+
LoadPackage( "GradedModules" )
1515
= HomalgFieldOfRationalsInSingular( )
1616
R = ℚ["x,y,z"]
1717
m = "[ x*y,y*z,z,0,0, x^3*z,x^2*z^2,0,x*z^2,-z^2, x^4,x^3*z,0,x^2*z,-x*z, 0,0,x*y,-y^2,x^2-1, 0,0,x^2*z,-x*y*z,y*z, 0,0,x^2*y-x^2,-x*y^2+x*y,y^2-y]";

0 commit comments

Comments
 (0)