ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Sat, 19 Nov 2011 13:22:37 +0100development of a framework for numeral systemshttps://ask.sagemath.org/question/8492/development-of-a-framework-for-numeral-systems/I plan do build a framework for numeral systems. Below you find some
thoughts written down. A draft of the possible class hierachy can also
be found there.
If you have any comments on those things or anything that should be
also included in that framework, then don't hesidate to post them.
Daniel
-----------------------
Numeral Systems in Sage
-----------------------
draft
Goals
-----
- representation of elements as digital expansions
- support of infinite expansions, multi-expansions (one position can
have
more digits)
- (fast) arithmetic of expansions (+, -, \*, /, **)
- action of expansion on something (e.g. act on points of elliptic
curve
and e.g. performed a by a Horner scheme)
- support of languages on the expansion (e.g. w-NAF (non-adjacent
form))
- different algorithms to calculate expansions (e.g. w-NAF (non-
adjacent
form))
- test for optimality of language
- calculation of sequences in conjunction with dynamical system
together
with the calculation of the expansions (cf. shift radix systems)
- support of continued fractions (some algorithms already exist for
that and
maxima supports continued fractions)
- support of joint expansions (digits are tuples)
- numeral systems often have connections to transducer; keep that in
mind
during the design process
Class Hierachy
--------------
Examples (of classes) of numeral systems are written with [].
NumeralSystem
+-- PositionalNumeralSystem
| +-- IntegerTupleIndexNumeralSystem
| +-- IntegerIndexNumeralSystem
| | +-- AbstractNumeralSystem
| | | +-- BaseNumeralSystem
| | | +-- AlgebraicBaseNumeralSystem
| | | +-- ImaginaryQuadraticBaseNumeralSystem
| | | | +-- [QuaterImaginary]
| | | | +--
[ImaginaryQuadraticBaseMNRDigits]
| | | +-- RealBaseNumeralSystem
| | | +-- IntegerBaseNumeralSystem
| | | | +--
PositiveIntegerBaseNumeralSystem
| | | | | +-- [Binary]
| | | | | +-- [Decimal]
| | | | | +-- [BalancedTernary]
| | | | | +-- [Babylonian]
| | | | +--
NegativeIntegerBaseNumeralSystem
| | | +-- [GoldenRatioBase]
| | +-- MixedRadixNumeralSystem
| | | +-- RecurrenceNumeralSystem
| | | | +-- [FibonacciBase]
| | | +-- [Money]
| | | +-- [FactorialNumeralSystem]
| | | +-- [DateTime]
| | +-- [FactorNumeralSystem]
| +-- [IntegerDoubleBases]
+-- [RomanNumeralSystem]
+-- [UnaryNumeralSystem]
Some Notes on the classes
-------------------------
NumeralSystem:
- base class for everything (abstract base class)
- elements have +,-,*,/, but none is implemented (implementation in
inherited class)
PositionalNumeralSystem:
- has function ``value_at_position(position, value)`` which gives
value
of singleton
- operation to add singletons can be given (e.g. addition)
- the positions can be everything (every hashable element of Sage)
IntegerTupleIndexNumeralSystem:
- positions are tuples (of fixed length) of integers
IntegerIndexNumeralSystem:
- positions are integers, special case of
IntegerTupleIndexNumeralSystem
AbstractNumeralSystem:
- function `\phi` from base `i` to base `i+1`
MixedRadixNumeralSystem
- bases are fixed numbers `b_0, b_1, b_2,...`
- digits and bases are multiplied
BaseNumeralSystem
- inherited from both AbstractNumeralSystem and
MixedRadixNumeralSystem
- bases are `b^i`
AlgebraicBaseNumeralSystem
- base `b` is a complex number (root of polynomial over ZZ)
ImaginaryQuadraticBaseNumeralSystem, RealBaseNumeralSystem, ...
- special cases of AlgebraicBaseNumeralSystem
RecurrenceNumeralSystem:
- recurrence on bases, e.g. `b_n=2*b_{n-1}+b_{n-2}`
- e.g. [FibonacciBase] # `b_n = b_{n-1} + b_{n-2}`
[Money]
- bases, e.g. for Euro, are 0.01, 0.02, 0.05, 0.10, 0.20, 0.50, 1, 2,
5,
10, 20, 50, 100, 200, 500
[FactorialNumeralSystem]
- bases 0!,1!,2!,... digits for position `n!` are `0...(n-1)`
[DateTime]
- bases year, month, day, hour, minute, second
Daniel KrennSat, 19 Nov 2011 13:22:37 +0100https://ask.sagemath.org/question/8492/What file does the "in" operator reside in?https://ask.sagemath.org/question/8485/what-file-does-the-in-operator-reside-in/When I run something like
sage: 32 in ZZ
True
Where is this "in" operator defined? In general, is there a nice way to trace something like this to find the file(s) being accessed?process91Thu, 17 Nov 2011 01:27:19 +0100https://ask.sagemath.org/question/8485/On what versions should Trac patches be based?https://ask.sagemath.org/question/8135/on-what-versions-should-trac-patches-be-based/I see that alphas and release candidates come out a lot faster than "released" versions of Sage. Should development patches be based on these pre-releases or on the current release? Furthermore, if I spot a patch on Trac that is based on an older version of Sage, should I go ahead and re-base the patch?
Notably, I have not found a clear answer in the Developer's Guide.
UPDATE: When producing the next stable, are the patches which are based on pre-releases "back-rebased" to the current stable? If so, is this a reason at all to favor basing on the current stable, rather than on the latest pre-release?Kelvin LiSat, 28 May 2011 02:22:58 +0200https://ask.sagemath.org/question/8135/What is the standard pickle jar for and how do I update ithttps://ask.sagemath.org/question/7692/what-is-the-standard-pickle-jar-for-and-how-do-i-update-it/I started Trac #9907, which basically consists of a relocation of some general decorators into `sage.misc.decorators`. However, after applying the patch, the doctest for `sage.structure.sage_object.unpickle_all` fails. It seems to be because there is a standard pickle jar which still contains the information that the decorators are located in `sage.plot.misc`.
Is it correct that there is such a pickle jar? In that case, what for, and how do I get about updating it and fixing my patch?
Cheers, JohanjsrnFri, 17 Sep 2010 05:32:18 +0200https://ask.sagemath.org/question/7692/Development of help-fileshttps://ask.sagemath.org/question/7654/development-of-help-files/I have been using MATLAB for long time in past and recently shifted to SAGE. One think I am missing here is 'suggestions' or 'related functions' in the helh-file in the MATLAB. For example, suppose one has a list A and he wants to remove first element of it. Now if one looks for a 'remove', he may also be interested in other list related commands like - 'append','clear','add',etc.
Is there any scope of bring this modifications in help-files in near future? hector1618Sat, 11 Sep 2010 15:36:49 +0200https://ask.sagemath.org/question/7654/Guided work for sage development.https://ask.sagemath.org/question/7643/guided-work-for-sage-development/I am a postgraduate student of mathematics at IIT-Roorkee. I am interested in number theory,abstract algebra,algorithms. I don't use SAGE in my research work because I am not doing any. But I would like to contribute to sage by developing some programs/scripts. Since most of the things I know are already been coded, is it possible for me to get some guided work to work on? hector1618Fri, 27 Aug 2010 14:58:15 +0200https://ask.sagemath.org/question/7643/does `sage -testall` test #long doctests?https://ask.sagemath.org/question/7601/does-sage-testall-test-long-doctests/Is it equivalent to `make test`, or to `make testlong`? Does it have a parallel option?
I'm attempting to clarify some of the "how to review patches" parts of the developer guide, and in different places I see different commands for doctesting the entire sage library.nilesFri, 20 Aug 2010 14:04:22 +0200https://ask.sagemath.org/question/7601/should I _really_ review trac tickets?https://ask.sagemath.org/question/7597/should-i-_really_-review-trac-tickets/As a new developer to sage, it's not clear when a person should start reviewing patches. Perhaps that's intentional, since perhaps different people are ready at different times, but some guidelines would be helpful. For example, "wait until you have at least a couple of positively reviewed patches", or "despite the great need for patch reviews, developers active for less than one year are not expected to review patches". Do either of these really make sense?
The sage [developer guide][1] simply says:
> If someone (other than you) has posted a patch for a ticket on the trac server, you can review it.
And then proceeds to give instructions.
About the instructions: There are two lists of instructions for patch reviewers, with slightly different advice; the short one links to the long one, but not vice versa, and I don't think the content of the short one is exactly contained in the long one.
short: Walking Through the Development Process: [reviewing a patch][2]
long: The Sage Trac Server: [reviewing patches][1]
Here are some further issues not addressed by either set of instructions:
* conforming to sage/python coding conventions: how thorough must the reviewer's knowledge be? (am I really expected to know and enforce _all_ of the python coding conventions, for example)
* author/contributor names should be added to source (I thought I saw this somewhere else in the developer guide)
* ticket number should be mentioned in comments (I learned this from a reviewer of one of my patches)
* `make ptestlong` must pass all tests for the patch to be included; `make ptest` is not sufficient in general. (learned this the hard way)
* the `#random` tag is no longer (never was?) necessary, even though you see it in some sage documentation; the random seed is always the same when doctesting, so you really have to implement a random test suite if you want randomized tests.
[1]: http://www.sagemath.org/doc/developer/trac.html#reviewing-patches
[2]: http://www.sagemath.org/doc/developer/walk_through.html#reviewing-a-patchnilesThu, 19 Aug 2010 17:54:19 +0200https://ask.sagemath.org/question/7597/