Docstring: accuracy/completeness of method signature #2034
Replies: 7 comments 8 replies
-
Sorry! I meant |
Beta Was this translation helpful? Give feedback.
-
As Wolfram suggested, I have looked at what was done for Weyl algebras. Here is a quick summary.
which corresponds exactly to what the actual method signature is, namely:
To help the user there is also a simple example in the docstring:
|
Beta Was this translation helpful? Give feedback.
-
Just for the record, I quote below the constructor from
For some reason |
Beta Was this translation helpful? Give feedback.
-
On Fri, Mar 10, 2023 at 07:22:57AM -0800, JohnAAbbott wrote:
Upon further reflection, I feel uneasy about allowing mixed types inside the vector of variable names: for instance
```
P, _ = polynomial_ring(QQ, [:x, "y", 'z']);
```
It is surely neater/clearer if all the elements of the vector are of the same type -- or do you disagree?
I agree - but would not invest any time to enforce this.
the first step internally is to convert to symbols
if a user wants to mix, they are welcome to it - as far as I am
concerned....
What is the downside? What is the upside?
… --
Reply to this email directly or view it on GitHub:
#2034 (reply in thread)
You are receiving this because you are subscribed to this thread.
Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
I'm hoping soon to make a concrete proposal for specifying variable names which works uniformly for all polynomial rings. |
Beta Was this translation helpful? Give feedback.
-
My ideas are still not so clear, but i am thinking of something similar to what CoCoA does:
The main advantage is that this is relatively easy to type in -- which is good for interactive use. For subscripted names we could do something like
It is important for interactive use that |
Beta Was this translation helpful? Give feedback.
-
I am "happy to discuss this in person in a larger round, but to me that
is a step in the wrong direction. We decided to use julia to avoid
having to design and maintain our own language.
Yes, we could return weird indexed variables as dictionaries, however,
most of the array functionality won't work - and cannot be made to
work.\Yes we could also provide our own weird array code - supporting as
much of juli as possible
But whatfor? So that in some use cases users can use weird indices?
WOuldn't it be better tp try to educate users about the amazing ways you
can achieve the desired efect in julia?
…On Wed, Mar 15, 2023 at 08:28:08AM -0700, JohnAAbbott wrote:
My ideas are still not so clear, but i am thinking of something similar to what CoCoA does:
```
P, (x,y,z) = polynomial_ring(QQ, "x,y,z");
```
The main advantage is that this is relatively easy to type in -- which is good for interactive use.
A disadvantage is that we must design a "language" for specifying the names of the variables, and write a parser.
There is already a parser package for Julia (based on PCRE2 apparently). I'm not sure how easy it would be to use here.
For subscripted names we could do something like
```
P,(x,y) = polynomial_ring(QQ, "x[1:10],y[0:10,0:10]");
```
It is important for interactive use that `y[0,0]` works as expected: namely it gives the variable whose name is `y[0,0]`. This could be achieved via an "offset array" or via a `Dict` map. I don't currently have a good argument in favour of one approach over the other. If the "index space" is rectangular then an array could work well. It may also depend on error message/handling, should the user give an out-of-range index.
--
Reply to this email directly or view it on GitHub:
#2034 (comment)
You are receiving this because you commented.
Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
How accurate should the summary of method signatures in a docstring be?
In my exterior algebra implementation I took a short-cut for readability; is this acceptable?
Docstring reports the following signatures:
But the actual code is the following:
PS actually I now wonder whether
Char
should really beAbstractChar
(but this is less important currently)Beta Was this translation helpful? Give feedback.
All reactions