diff --git a/PackageInfo.g b/PackageInfo.g index dfd9418..beecc87 100644 --- a/PackageInfo.g +++ b/PackageInfo.g @@ -10,7 +10,7 @@ SetPackageInfo( rec( PackageName := "MachineLearningForCAP", Subtitle := "Exploring categorical machine learning in CAP", -Version := "2024.07-12", +Version := "2024.07-13", Date := (function ( ) if IsBound( GAPInfo.SystemEnvironment.GAP_PKG_RELEASE_DATE ) then return GAPInfo.SystemEnvironment.GAP_PKG_RELEASE_DATE; else return Concatenation( ~.Version{[ 1 .. 4 ]}, "-", ~.Version{[ 6, 7 ]}, "-01" ); fi; end)( ), License := "GPL-2.0-or-later", diff --git a/examples/Expressions.g b/examples/Expressions.g index 1dbcc61..c63c147 100644 --- a/examples/Expressions.g +++ b/examples/Expressions.g @@ -67,6 +67,9 @@ LazyDiff( e, 1 )( dummy_input );; # "(((Sin(x1))/(Cos(x1)))+((Sin(x2))^(2)))+((Cos(x2))^(2))", 1 )( [ x1, x2, x3 ] ); JacobianMatrixUsingPython( [ x1*Cos(x2)+Exp(x3), x1*x2*x3 ], [ 1, 2, 3 ] ); #! [ [ "Cos(x2)", "-x1*Sin(x2)", "Exp(x3)" ], [ "x2*x3", "x1*x3", "x1*x2" ] ] +JacobianMatrix( [ "x1", "x2", "x3" ], [ "x1*Cos(x2)+Exp(x3)", "x1*x2*x3" ], + [ 1, 2, 3 ] )(dummy_input); +#! [ [ Cos(x2), (-x1)*Sin(x2), Exp(x3) ], [ x2*x3, x1*x3, x1*x2 ] ] LaTeXOutputUsingPython( e ); #! "\\frac{\\sin{\\left(x_{1} \\right)}}{\\cos{\\left(x_{1} \\right)}} #! + \\sin^{2}{\\left(x_{2} \\right)} + \\cos^{2}{\\left(x_{2} \\right)}" @@ -93,4 +96,15 @@ labels := List( points, point -> SelectBasedOnCondition( point[2] < 0.5, 0, 1 ) #! 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ] ScatterPlotUsingPython( points, labels : size := "100", action := "save" );; # e.g, dir("/tmp/gaptempdirX7Qsal/") +AsCythonFunction( [ [ "x", "y" ], [ "z" ] ], [ "f", "g" ], [ "x*y", "Sin(z)" ] );; +# e.g., +# cd /tmp/gaptempdirI6rq3l/ +# +# start python! +# +# from cython_functions import f, g; +# +# # w = [ 2 entries :) ] +# +# # f(w) #! @EndExample diff --git a/gap/Tools.gi b/gap/Tools.gi index 707c08e..8e69b9b 100644 --- a/gap/Tools.gi +++ b/gap/Tools.gi @@ -690,8 +690,8 @@ InstallMethod( AsCythonFunction, fi; - Print( - Concatenation( "cd ", Filename( dir, "" ), "\n\n" ), + return + Concatenation( "cd ", Filename( dir, "" ), "\n\n", "start python!\n\n", "from cython_functions import ", JoinStringsWithSeparator( function_names, ", " ),