JuliaAlgebra / DynamicPolynomials.jl

Multivariate polynomials implementation of commutative and non-commutative variables
Other
60 stars 21 forks source link

Reconsider default exports #21

Closed saschatimme closed 6 years ago

saschatimme commented 6 years ago

I have been using DynamicPolynomials quite extensively so far and found that the lack of default exports (and documentation) of things like differentiate, evaluate and variables is a little bit cumbersome. Especially for new endusers the differentiation between MultivariatePolynomials and DynamicPolynomials can be quite confusing. Assume this use case: In HomotopyContinuation.jl we suggest to use DynamicPolynomials for input (and even export @polyvar). But let's say that an user wants to construct the gradient of a Lagrangian. Then he does not only have to look up DynamicPolynomials but also MultivariatePolynomials and needs to make the connection between both them.

I would propose to either reexport all exports of MultivariatePolynomials or at least the most common used subset. A small decrease in friction can make life much better :)

I can contribute the changes, but wanted to know your opinion on this. Also cc @PBrdng since I know he also uses it a lot.

blegat commented 6 years ago

I am not again reexporting some MultivariatePolynomials functions :) A code implementing an algorithm on polynomials should do using MultivariatePolynomials and a code creating polynomials should do using DynamicPolynomials. If a function is useful for manipulating polynomials such as differentiate, it makes sense to export them. What do you mean by lack of documentation ? differentiate, ... are documented no ?

PBrdng commented 6 years ago

Hi,

imo it would be convenient to reexport differentiate, evaluate, and especially variables.

What would also be cool is if one could call vectors of DynamicPolynomials to evaluate; i.e., f(x => 1) for something like f = [x-1, x-2].

saschatimme commented 6 years ago

What do you mean by lack of documentation ? differentiate, ... are documented no ? What I mean is this:

screen shot 2018-06-19 at 06 42 27

I have now idea that there is a differentiate function if I wouldn't know it. But this is probably just a lack of reexport, isn't it?

blegat commented 6 years ago

imo it would be convenient to reexport differentiate, evaluate, and especially variables

I'm ok with exporting these

What would also be cool is if one could call vectors of DynamicPolynomials to evaluate; i.e., f(x => 1) for something like f = [x-1, x-2].

Might be doable

I have now idea that there is a differentiate function if I wouldn't know it. But this is probably just a lack of reexport, isn't it?

Yes, if it is exported, it will be available though DynamicPolynomials.differentiate and will show in autocomplete