New version of the packages.
authorAntonio Jimenez Pastor <ajpastor@risc.uni-linz.ac.at>
Fri, 9 Mar 2018 14:03:55 +0000 (15:03 +0100)
committerAntonio Jimenez Pastor <ajpastor@risc.uni-linz.ac.at>
Fri, 9 Mar 2018 14:03:55 +0000 (15:03 +0100)
Now the class DDRing accepts algebraic extensions of QQ as
basic field. Also, this field is dinamicall computed assuming
that, if the base ring is a Polynomial Ring, the base field
is the same as the coefficients of the polynomials.

12 files changed:
Makefile
ajpastor/dd_functions/ddFunction.py
ajpastor/operator/operator.py
package-version.txt
releases/diff_defined_functions__0.0.zip
releases/diff_defined_functions__0.5.zip [new file with mode: 0644]
releases/old/diff_defined_functions__0.0__18.03.08_15:51:09.zip [new file with mode: 0644]
releases/old/diff_defined_functions__0.0__18.03.09_15:00:51.zip [new file with mode: 0644]
releases/old/diff_defined_functions__0.5__18.03.09_15:01:16.zip [new file with mode: 0644]
releases/old/diff_defined_functions__0.5__18.03.09_15:01:22.zip [new file with mode: 0644]
releases/old/diff_defined_functions__0.5__18.03.09_15:03:54.zip [new file with mode: 0644]
setup.py

index c1b7636..99ef63f 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -13,13 +13,17 @@ create:
        @echo "from pkgutil import extend_path;" > ./$(BASE)/__init__.py
        @echo "__path__ = extend_path(__path__, __name__);" >> ./$(BASE)/__init__.py
        
-zip:
+zip: clean_pyc
        @echo "Compressing the project into file" $(ZIP)".zip"...
        @rm -f ./releases/$(ZIP)__$(VERSION).zip
        @zip -r ./releases/$(ZIP)__$(VERSION).zip $(BASE) type SPKG.txt setup.py package-version.txt Makefile dependencies
        @cp ./releases/$(ZIP)__$(VERSION).zip ./releases/old/$(ZIP)__$(VERSION)__`date +'%y.%m.%d_%H:%M:%S'`.zip
        
-git:
+clean_pyc:
+       @echo "Cleaning the Python precompiled files (.pyc)"
+       @find . -name "*.pyc" -exec rm {} +
+       
+git: zip
        @echo "Pushing changes to public git repository"
        @git add -A
        @git commit
index 206f9e9..0436ce1 100644 (file)
@@ -61,7 +61,7 @@ class DDRing (Ring_w_Sequence, IntegralDomain):
     
     _Default_Base = PolynomialRing(QQ,x);
     _Default_Depth = _sage_const_1 ;
-    _Default_Base_Field = QQ;
+    _Default_Base_Field = None;
     _Default_Invertibility = None;
     _Default_Derivation = None;
     _Default_Operator = None;
@@ -119,7 +119,7 @@ class DDRing (Ring_w_Sequence, IntegralDomain):
             final_args[_sage_const_0 ][_sage_const_1 ] = final_args[_sage_const_0 ][_sage_const_1 ]._DDRing__original;
             
         ## Casting to tuple (so is hashable)
-        to_hash = tuple(tuple(el) for el in final_args[:_sage_const_3 ]);
+        to_hash = tuple(tuple(el) for el in final_args[:_sage_const_2 ]);
         final_args = tuple(tuple(el) for el in final_args);
         
         if(final_args[_sage_const_1 ][_sage_const_1 ] == _sage_const_0 ):
@@ -173,7 +173,22 @@ class DDRing (Ring_w_Sequence, IntegralDomain):
                 self.__original = base.__original;
             # Otherwise, we set this simplest ring as our current coefficient ring
             else:
-                self.base_field = base_field;
+                if(base_field is None):
+                    from sage.categories.pushout import PolynomialFunctor, FractionField;
+                    current = base;
+                    const = base.construction();
+                    while((not (const is None)) and (isinstance(const[_sage_const_0 ], PolynomialFunctor) or isinstance(const[_sage_const_0 ],FractionField))):
+                        current = const[_sage_const_1 ];
+                        const = current.construction();
+                        
+                    if(not current.is_field()):
+                        self.base_field = current.fraction_field();
+                    else:
+                        self.base_field = current;
+                        
+                        
+                else:
+                    self.base_field = base_field;
                 self.__depth = _sage_const_1 ;
                 self.__original = base;
             
@@ -191,7 +206,7 @@ class DDRing (Ring_w_Sequence, IntegralDomain):
             if(derivation is None):
                 try:
                     self_var = self.variables(True,False)[_sage_const_0 ];
-                    self.base_derivation = lambda p : p.derivative(self_var);
+                    self.base_derivation = lambda p : p.derivative(self.base()(self_var));
                 except IndexError:
                     self.base_derivation = lambda p : _sage_const_0 ;
             else:
index 73ac3b6..db7e061 100644 (file)
@@ -281,7 +281,7 @@ class Operator(object):
     def jp_value(self):
         ## TODO Be careful with this computation:oinly valid is the base field are the rational
         jp_pol = self.get_recursion_polynomial(self.forward_order);
-        return max([self.getOrder()-self.forward_order] + [root[_sage_const_0 ] for root in jp_pol.roots() if (root[_sage_const_0 ] in ZZ)]);
+        return max([self.getOrder()-self.forward_order] + [ZZ(root[_sage_const_0 ]) for root in jp_pol.roots() if (root[_sage_const_0 ] in ZZ)]);
        
     @derived_property 
     def jp_matrix(self):
index ba66466..2eb3c4f 100644 (file)
@@ -1 +1 @@
-0.0
+0.5
index 8dc107f..2e84631 100644 (file)
Binary files a/releases/diff_defined_functions__0.0.zip and b/releases/diff_defined_functions__0.0.zip differ
diff --git a/releases/diff_defined_functions__0.5.zip b/releases/diff_defined_functions__0.5.zip
new file mode 100644 (file)
index 0000000..52e0563
Binary files /dev/null and b/releases/diff_defined_functions__0.5.zip differ
diff --git a/releases/old/diff_defined_functions__0.0__18.03.08_15:51:09.zip b/releases/old/diff_defined_functions__0.0__18.03.08_15:51:09.zip
new file mode 100644 (file)
index 0000000..eef9740
Binary files /dev/null and b/releases/old/diff_defined_functions__0.0__18.03.08_15:51:09.zip differ
diff --git a/releases/old/diff_defined_functions__0.0__18.03.09_15:00:51.zip b/releases/old/diff_defined_functions__0.0__18.03.09_15:00:51.zip
new file mode 100644 (file)
index 0000000..2e84631
Binary files /dev/null and b/releases/old/diff_defined_functions__0.0__18.03.09_15:00:51.zip differ
diff --git a/releases/old/diff_defined_functions__0.5__18.03.09_15:01:16.zip b/releases/old/diff_defined_functions__0.5__18.03.09_15:01:16.zip
new file mode 100644 (file)
index 0000000..21326b2
Binary files /dev/null and b/releases/old/diff_defined_functions__0.5__18.03.09_15:01:16.zip differ
diff --git a/releases/old/diff_defined_functions__0.5__18.03.09_15:01:22.zip b/releases/old/diff_defined_functions__0.5__18.03.09_15:01:22.zip
new file mode 100644 (file)
index 0000000..21326b2
Binary files /dev/null and b/releases/old/diff_defined_functions__0.5__18.03.09_15:01:22.zip differ
diff --git a/releases/old/diff_defined_functions__0.5__18.03.09_15:03:54.zip b/releases/old/diff_defined_functions__0.5__18.03.09_15:03:54.zip
new file mode 100644 (file)
index 0000000..52e0563
Binary files /dev/null and b/releases/old/diff_defined_functions__0.5__18.03.09_15:03:54.zip differ
index 148a4ef..48c6900 100644 (file)
--- a/setup.py
+++ b/setup.py
@@ -3,10 +3,10 @@ from distutils.core import setup
 
 setup(
     name = "ajpastor",
-    version = "0.0",
+    version = "0.5",
     author = "Antonio Jimenez-Pastor",
     author_email = "antonio.jimenez-pastor@dk-compmath.jku.at",
-    licence = "GPL",
+    license = "GPL",
     packages = ["ajpastor", "ajpastor.dd_functions", "ajpastor.operator", "ajpastor.lazy", "ajpastor.misc", "ajpastor.tests"]
     )