Re: [sympy] Easy way to use S()

2023-07-07 Thread Isuru Fernando
Hi David,

You could write a simple converter to convert all ints to sympy Integers
if you are writing the code inside a function. See code below.

Isuru


import sympy
from sympy.interactive.session import int_to_Integer
import inspect
import types

def use_sympy_ints(f):
# https://stackoverflow.com/q/57480368/4768820
source = inspect.getsource(f)
source = '\n'.join(source.splitlines()[1:]) # remove the decorator
first line.
old_code_obj = f.__code__
new_ast= int_to_Integer(source)
new_code_obj = compile(new_ast, old_code_obj.co_filename, 'exec')
g = dict(f.__globals__)
g['Integer'] = sympy.Integer
new_f = types.FunctionType(new_code_obj.co_consts[0], g)
return new_f

@use_sympy_ints
def foo(x):
return x + 1 / 2

On Fri, Jul 7, 2023 at 3:32 AM Aaron Meurer  wrote:

> On Thu, Jul 6, 2023 at 4:15 PM David Bailey  wrote:
> >
> > On 05/07/2023 21:40, Aaron Meurer wrote:
> > > For interactive use, just passing a string to S() (or equivalently
> > > sympify() or parse_expr()) is the simplest way to deal with this.
> > > However, I would avoid this for non-interactive usage (i.e., any code
> > > that gets saved to be executed later). Putting your expression in a
> > > string breaks the ability for Python to parse it directly, meaning
> > > things like simple syntax errors won't be caught until the code gets
> > > run.
> > >
> > > You should also be very careful when doing this if you use
> > > assumptions. S("x + 1") will create a symbol x with the default
> > > assumptions. If you already defined x with assumptions, like
> > >
> > > x = symbols('x', real=True)
> > >
> > > then this will be a *different* symbol. For example:
> >
> > Thanks for that caution, Aaron,
> >
> > This whole problem reminds me vaguely of a friend of mine that bought an
> > early Sinclair calculator. He discovered that ln(2) was seriously
> > inaccurate, so he wrote to them. They replied that there was nothing
> > wrong with his calculator, he had just chosen an unfortunate example!
> >
> > What I'm trying to say is that there must be people out there who gave
> > given up on SymPy after discovering what it does to 1/2*x, or worse
> > still, got an error in their work (particularly if using Python 2).
>
> No one should be using Python 2 at this point. So fortunately that
> particular headache is behind us.
>
> >
> > Thinking about it, I can see how hard it is to do something really
> > effective about this problem, but couldn't you prevail on the Python
> > term to insert a hook in the Python parser to make it possible to change
> > an input string before Python parses it and applies its integer division
> > rule?
>
> That particular way of solving the problem would very likely be
> rejected. It's basically equivalent to adding macros to the language,
> which has been rejected multiple times before.
>
> I have wondered if it wouldn't be possible for Python to keep track of
> how purely numeric constants are created at compile time and store
> that information on the constant. Since it would only apply to pure
> numbers and would only happen at compile time, it would have basically
> no runtime penalties. That would also allow something like
> 1.001, which automatically truncates to 1.0, to create
> sympy.Float('1.001'). But it's only a vague idea I've
> ruminated on and I haven't written to the core Python team about it.
>
> Aaron Meurer
>
> >
> > David
> >
> > --
> > You received this message because you are subscribed to the Google
> Groups "sympy" group.
> > To unsubscribe from this group and stop receiving emails from it, send
> an email to sympy+unsubscr...@googlegroups.com.
> > To view this discussion on the web visit
> https://groups.google.com/d/msgid/sympy/d6b19b21-d61c-e4f8-3116-f5f64ac6ab48%40dbailey.co.uk
> .
>
> --
> You received this message because you are subscribed to the Google Groups
> "sympy" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sympy+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/sympy/CAKgW%3D6LXNmwPMEc8Kaixa0dxrd3bV8R%3DHJQxXqSz43w3aXu8nQ%40mail.gmail.com
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sympy+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/CA%2B01voNMTZ3n6uL%2BziPb56zUG%3DAnzJQ4jiVTnuY5C%2BX0fCz6Sg%40mail.gmail.com.


Re: [sympy] Parsing expressions problem | "ImportError: Clang is not installed, cannot parse C code"

2022-04-19 Thread Isuru Fernando
It should be python-clang.

Isuru

On Tue, Apr 19, 2022 at 2:23 PM Aaron Meurer  wrote:

> The error message should be improved there. You need clang-python.
>
> Aaron Meurer
>
> On Tue, Apr 19, 2022 at 1:20 PM Audrius-St 
> wrote:
> >
> > Hello,
> >
> > I am attempting to parse C code into Python using SymPyExpression but am
> receiving the error message "ImportError: Clang is not installed, cannot
> parse C code"
> >
> > However, I'm quite certain that I have Clang installed
> >
> > $ conda list clang
> > # NameVersion Build  Channel
> > clang 13.0.1   ha770c72_0conda-forge
> > clang-13   13.0.1   default_hc23dcda_0conda-forge
> > libclang-cpp13 13.0.1  default_hc23dcda_0conda-forge
> >
> > Code fragment:
> >
> > src_X = """
> > inline double advanceX(
> > double const& x,
> > double const& px,
> > double const& y,
> > double const& py,
> > double const& t)
> > // The C code output from FORM starts array indices at 1 not 0. Go
> figure.
> > std::array w;
> >
> > w[1]=1./3.*y;
> > w[2]=139./33. + 19./2.*y;
> > w[2]=w[2]*w[1];
> > . . .
> > double x_t=w[1] + x;
> >
> > return x_t;
> > """
> >
> > def main():
> > p = SymPyExpression(src_X, 'c')
> > p.convert_to_python()
> > print('p:', p)
> >
> >
> > if __name__ == "__main__":
> > main()
> >
> > System:
> > Python 3.9.12
> > Sympy 1.10.1
> > VS Code 1.66.2
> > Ubuntu 20.04 on WSLg 1.0.33
> >
> > Is there some parameter in VS Code that I need to set?
> > Puzzled.
> >
> > Another unrelated issue. Just now, when I attempt to go to
> https://docs.sympy.org/
> > I receive the message
> >
> > 404
> >
> > There isn't a GitHub Pages site here.
> >
> >
> > --
> > You received this message because you are subscribed to the Google
> Groups "sympy" group.
> > To unsubscribe from this group and stop receiving emails from it, send
> an email to sympy+unsubscr...@googlegroups.com.
> > To view this discussion on the web visit
> https://groups.google.com/d/msgid/sympy/5a69ee30-2084-4f8c-929e-ddab57e254b0n%40googlegroups.com
> .
>
> --
> You received this message because you are subscribed to the Google Groups
> "sympy" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sympy+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/sympy/CAKgW%3D6LzBM32J9_%3DMK0na7SZeC5VBn335u2AYJJa0x%3Dpajppgg%40mail.gmail.com
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sympy+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/CA%2B01voP-rNCKuH1segyvsjEHCWBu5W5bsjbJ12SDzHXU155RWA%40mail.gmail.com.


Re: [sympy] Faster symbolics

2022-04-15 Thread Isuru Fernando
Hi Oscar,

Here's a few things that are different in SymEngine than SymPy.

> As an example it would be trivial in SymPy to make substitutions
involving large expressions and many replacements much faster with a
small redesign. The problem though is backwards compatibility: each
expression class can implement its own _eval_subs method so for
backwards compatibility the subs implementation must recurse in the
same slow way once throughout the whole tree for each replacement that
is to be made. (There are ways to work around this but the design
makes it harder than it should be.)

In SymEngine, classes do not have such a method and therefore cannot
extend for eg: subs function.
However the subs function itself (SubsVisitor class technically) can be
extended.

> This is a small example of a more general problem. Using classes means
you have to use the interfaces of the class which means that efficient
algorithms needing something not provided by that public interface are
impossible. Even worse both SymPy and SymEngine allow the
*constructors* of those classes to do nontrivial work without
providing any good way to override that. This means that you can't
even represent a symbolic expression without allowing arbitrary code
execution: it's impossible to optimize higher-level algorithms if you
have so little control over execution from the outside.

No, SymEngine does not do anything in the constructor of the C++ class
itself. (For eg: class "Add"). We have different functions (For eg:
function "add")
that do complicated functionality to create the C++ class. A user is allowed
to create the C++ class directly and we assume that the data structure that
the
user passed is internally consistent in Release mode and we check user
input in Debug mode. This allows the user to do low level optimizations
when they know that going through the complicated function is unnecessary.

> There are ways that this can be improved in both SymPy and SymEngine
but I also think that for many important operations the basic design
used by these is limiting in a big-O sense: the design constrains what
algorithms can be used. SymEngine is faster than SymPy in a brute
force sense by using C++ rather than Python but it would be possible
to make something both faster and more flexible if a different design
was used at a basic level.

I disagree about this in SymEngine. For eg: SymPy's extensibility
of classes prevents optimizations that SymEngine can do because symengine
doesn't have an equivalence of `_eval_subs` or similar.
Some of the optimizations in SymEngine like Aaron said leads to better
big-O complexities. i.e. the ratio between the two modules is not always a
constant as input size increases.

Isuru



On Thu, Apr 14, 2022 at 1:26 PM Oscar Benjamin 
wrote:

> On Thu, 14 Apr 2022 at 18:16, Tirthankar Mazumder
>  wrote:
> >
> > On Thursday, April 14, 2022 at 10:04:28 PM UTC+5:30 Oscar wrote:
> >>
> >> On Tue, 12 Apr 2022 at 19:26, Matthias Köppe 
> wrote:
> >>
> >> > - status and plans regarding SymEngine
> >>
> >> I don't know about the status of SymEngine. I can't say that I can see
> >> any significant work happening on the SymPy side to integrate
> >> SymEngine any further with SymPy. My personal view is that for faster
> >> symbolics a different approach is needed in general but SymEngine
> >> seems to have the same design flaws as SymPy itself in that respect.
> >
> > Hi, as someone who is relatively new to the SymPy + SymEngine project,
> and wants to work on SymEngine as a part of their GSoC, I would appreciate
> it if you could elaborate a bit on what design flaws you are referring to.
>
> The basic design of the way that symbolic expressions are represented
> in SymPy and SymEngine is through the use of classes to represent
> different types of expression e.g. there is a class Pow and an
> expression like x**y is represented by an instance of that class
> created as Pow(x, y).
>
> Using classes like this makes it hard to extend the system with new
> types of symbolic expression e.g. with SymEngine you can't make a new
> kind of symbolic expression without writing C++ code so if you are
> using SymEngine from Python then it isn't extensible. With SymPy you
> could at least make your own symbolic expression class in Python but
> then it still doesn't work so well because there are so many places in
> the codebase where particular types of expression are special-cased
> meaning that any new symbolic expression type cannot be handled by
> functions like solve, integrate etc.
>
> The other problem with using classes is that it means that the basic
> data structure that is used to represent expressions is fixed from the
> outside. In SymPy and SymEngine that data structure is a tree and all
> algorithms recurse through that tree. More efficient data structures
> for some given operation can't be used because the implementation of
> each symbolic expression type requires that you always use instances
> of the class meaning that 

Re: [sympy] Re: SymPy 1.5 released

2019-12-14 Thread Isuru Fernando
FYI, NumPy has already dropped python 2.7 support in 1.17.0 in July. They
are supporting 1.16.x until January, 1 2020 and 1.16.x will no longer be
supported.

Isuru

On Sat, Dec 14, 2019 at 5:36 PM Oscar Benjamin 
wrote:

> I don't see why anything dramatic will happen when NumPy drops support
> for Python 2.7. The current releases of both NumPy and SymPy will
> still be available for Python 2.7. Gradually over time more new
> releases will emerge that can't be installed on Python 2.7 but nothing
> will immediately break for people who continue to use 2.7 with NumPy
> and/or SymPy. Those users will just be stuck with the current versions
> of 3rd party packages as well as an old version of the interpreter.
>
> On Sat, 14 Dec 2019 at 23:28, Jason Moore  wrote:
> >
> > I'd like for us to hang on to Py27 until we see what happens when NumPy
> drops it. I personally feel like shit might hit the fan.
> >
> > Jason
> > moorepants.info
> > +01 530-601-9791
> >
> >
> >
> > On Sat, Dec 14, 2019 at 3:05 PM Aaron Meurer  wrote:
> >>
> >>
> >>
> >> On Sat, Dec 14, 2019 at 2:31 PM Oscar Benjamin <
> oscar.j.benja...@gmail.com> wrote:
> >>>
> >>> Python 2.7 support can be dropped in SymPy 1.6 (the next release). We
> >>> don't yet know though if we will need a 1.5.1 bugfix release though so
> >>> I'd prefer to give it a few weeks before dropping Python 2.7 from
> >>> Travis. I think that as soon as Python 2.7 is not tested SymPy will
> >>> stop working on it because it will become unimportable within a few
> >>> PRs.
> >>
> >>
> >> We should make sure __init__.py stays importable so we can give an
> error message about Python 2 not being supported.
> >>
> >>>
> >>>
> >>> Once 2.7 is removed from Travis there are a number of places in the
> >>> codebase that can be cleaned up (noted with the "dropping Python 2"
> >>> label) and a bunch of compat code that can be removed.
> >>>
> >>> SymPy's current Python version support policy is here
> >>> https://github.com/sympy/sympy/wiki/Python-version-support-policy
> >>> and says that a version of Python is supported until it reaches EOL.
> >>> For Python 3.5 that is September 2020 according to the table here:
> >>> https://devguide.python.org/#status-of-python-branches
> >>>
> >>> Dropping 3.5 before then wouldn't match the support policy but if
> >>> there are strong advantages then it can be discussed.
> >>
> >>
> >> We might need to become more aggressive at some point. Python is
> planning on speeding up their release cadence so with the current policy
> there will be more Python versions for us to support.
> >>
> >> Aaron Meurer
> >>
> >>>
> >>>
> >>> --
> >>> Oscar
> >>>
> >>> On Sat, 14 Dec 2019 at 15:26, Francesco Bonazzi <
> franz.bona...@gmail.com> wrote:
> >>> >
> >>> > Great new!
> >>> >
> >>> > Are we going to drop Python 2.7 and 3.4 support?
> >>> >
> >>> > There are two nice things to have:
> >>> >
> >>> > support for type annotations with enforcement in testing.
> >>> > integration of MatchPy into SymPy (unfortunately this step requires
> to drop Python 3.5 support as well, as MatchPy is Python 3.6+ only).
> >>> >
> >>> >
> >>> > On Saturday, 14 December 2019 02:38:23 UTC+1, Oscar wrote:
> >>> >>
> >>> >> On Fri, 13 Dec 2019 at 21:41, Oscar Benjamin 
> wrote:
> >>> >> >
> >>> >> > Hi all,
> >>> >> >
> >>> >> > It is my pleasure to announce the release of SymPy 1.5 today. I
> have
> >>> >> > uploaded the release files to for this release to PyPI so you
> should
> >>> >> > be able to install or upgrade with
> >>> >> >
> >>> >> > $ pip install -U sympy
> >>> >>
> >>> >> I just realised I didn't give the hashes for the release files
> which are
> >>> >>
> >>> >> 8ae4a95378304ed4081921767fe46f0adf5921bf471c9f5df425abf2c655d751
> >>> >> sympy-1.5-py2.py3-none-any.whl
> >>> >> 31567dc010bff0967ef7a87210acf3f938c6ab24481581fc143536fb103e9ce8
> >>> >> sympy-1.5.tar.gz
> >>> >> b880a0819efac35661e59ec4341e3df7667e51f952033b12a91361f792458639
> >>> >> sympy-docs-html-1.5.zip
> >>> >> 2f366888c0efc86bf031e1db4dd988463c26583a8582e33b4bc85eb6b14d4ea1
> >>> >> sympy-docs-pdf-1.5.pdf
> >>> >>
> >>> >> I'm interested to know: does anyone check these?
> >>> >>
> >>> >> --
> >>> >> Oscar
> >>> >
> >>> > --
> >>> > You received this message because you are subscribed to the Google
> Groups "sympy" group.
> >>> > To unsubscribe from this group and stop receiving emails from it,
> send an email to sympy+unsubscr...@googlegroups.com.
> >>> > To view this discussion on the web visit
> https://groups.google.com/d/msgid/sympy/b17bed68-2653-4bb9-8b54-fa19eaeb18e3%40googlegroups.com
> .
> >>>
> >>> --
> >>> You received this message because you are subscribed to the Google
> Groups "sympy" group.
> >>> To unsubscribe from this group and stop receiving emails from it, send
> an email to sympy+unsubscr...@googlegroups.com.
> >>> To view this discussion on the web visit
> https://groups.google.com/d/msgid/sympy/CAHVvXxTr0NMn5w2ZKbbCTRdtZHp0Fq4H18vrHCFr8%2BK5KbO%2BbA%40mail.gmail.com
> .
> 

Re: [sympy] Benchmarking CI

2019-05-20 Thread Isuru Fernando
Forget that. That was because I also pushed to a branch. For PRs, we'll
have to set up a bot to push to a gitlab branch.

Isuru

On Tue, May 21, 2019 at 12:41 AM Isuru Fernando  wrote:

> > Yes, but not by default, one has to setup a bot to do that. Here is how
> somebody already did exactly that:
>
> There's a new feature in gitlab that takes care of this. See
> https://docs.gitlab.com/ee/ci/ci_cd_for_external_repos/github_integration.html
>
> I just created https://gitlab.com/isuruf/sympy/ to mirror my github fork
> and created a PR at https://github.com/isuruf/sympy/pull/8. Gitlab CI
> status is running there without a bot.
>
> Isuru
>

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sympy+unsubscr...@googlegroups.com.
To post to this group, send email to sympy@googlegroups.com.
Visit this group at https://groups.google.com/group/sympy.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/CA%2B01voO6YBYqmt9t2JCTR5PGfwh05T%3Dti2bgCyMCNf5c5%2BsBzA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [sympy] Benchmarking CI

2019-05-20 Thread Isuru Fernando
> Yes, but not by default, one has to setup a bot to do that. Here is how
somebody already did exactly that:

There's a new feature in gitlab that takes care of this. See
https://docs.gitlab.com/ee/ci/ci_cd_for_external_repos/github_integration.html

I just created https://gitlab.com/isuruf/sympy/ to mirror my github fork
and created a PR at https://github.com/isuruf/sympy/pull/8. Gitlab CI
status is running there without a bot.

Isuru

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sympy+unsubscr...@googlegroups.com.
To post to this group, send email to sympy@googlegroups.com.
Visit this group at https://groups.google.com/group/sympy.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/CA%2B01voOkhe3KFyWgn_Uu82p%2Bg3PNgs6n3AE0uYMueX0s2x1mHQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [sympy] Benchmarking CI

2019-05-20 Thread Isuru Fernando
On Mon, May 20, 2019 at 4:30 PM Aaron Meurer  wrote:

> On Mon, May 20, 2019 at 2:45 PM Isuru Fernando  wrote:
> >
> >
> > On Mon, May 20, 2019 at 3:34 PM Aaron Meurer  wrote:
> >>
> >> Thanks. My biggest question has been how we can do it in the cloud.
> >> Most CI services run multiple concurrent jobs on the same machine,
> >> making the performance inconsistent. Does drone.io let you have a
> >> dedicated machine?
> >
> >
> > Drone.io has a shared cloud offering which we don't want. As you
> mentioned we can buy a cheap dedicated machine and install drone on it for
> free.
> >
> > Drone might support dedicated machines on the cloud, but I'm not sure.
> Travis-CI supports dedicated machines, but we looked at this for
> conda-forge and they were quite expensive.
>
> I see, so Drone is a CI software, similar to gitlab CI or Azure.


Yes


> We
> will need to decide which of those is the most appropriate to use.
> I've heard good things about GitLab CI. Can it not be used with GitHub
> repos?
>

I though it couldn't, but looks like they do,
https://about.gitlab.com/handbook/marketing/product-marketing/enablement/github-ci-cd-faq/#open-source-projects-opportunity
I like Gitlab CI and I know Ondrej has experience setting up Gitlab runners
on dedicated machines.


> Regarding the hardware, the question is if there are cloud providers
> that provide dedicated machines, and how much they cost. If anyone has
> any suggestions for this let me know.


If we go with Gitlab CI with github integration, we can use something like
https://aws.amazon.com/ec2/pricing/dedicated-instances/

Isuru


> Alternately, what's a reasonably
> cheap box we can put together to host ourselves, and what are the
> tradeoffs there?
>
> Aaron Meurer
>
> >
> >>
> >> If we can't do it in the cloud, another alternative would be to buy a
> >> cheap dedicated machine that we can provision ourselves. We have funds
> >> in our NumFOCUS account to do either of these, so the question is
> >> which will be easier for us to set up and maintain. What do the sumpy
> >> benchmarks run on?
> >
> >
> > It's a dedicated machine somewhere in the university running a gitlab
> runner service. Not a cloud machine.
> >
> > Isuru
> >
> >>
> >> Aaron Meurer
> >>
> >> On Mon, May 20, 2019 at 1:59 PM Isuru Fernando 
> wrote:
> >> >
> >> > Hi,
> >> >
> >> > I setup asv in Gitlab CI for https://gitlab.tiker.net/inducer/sumpy.
> It runs the PR head and master (cached) and errors if there is a test with
> 10% regression.
> >> > Script is at
> https://gitlab.tiker.net/inducer/ci-support/blob/master/build-and-benchmark-py-project.sh.
> It runs on a dedicated Gitlab runner.
> >> >
> >> > For sympy, you'll have to have a dedicated machine for benchmarking
> and some CI service that integrates with github installed. (Maybe Drone CI
> which is free for 15000 builds per year.
> https://drone.io/enterprise/starter/#features). You'll have to limit to 1
> concurrent job to avoid multiple PRs affecting each other.
> >> >
> >> > Isuru
> >> >
> >> > On Mon, May 20, 2019 at 1:20 PM Aaron Meurer 
> wrote:
> >> >>
> >> >> Hello everyone.
> >> >>
> >> >> I would like to start looking into setting up some kind of
> >> >> benchmarking CI for SymPy.
> >> >>
> >> >> Ideally the CI would work just like Travis or codecov. It would run
> >> >> the benchmark suite on every pull request, and report if there are
> any
> >> >> major performance regressions.
> >> >>
> >> >> If anyone has any thoughts on how to go about doing this, let me
> know.
> >> >> If anyone knows of any projects that already do this, let me know
> that
> >> >> as well.
> >> >>
> >> >> Finally, if anyone is interested in helping out with this, please
> let me know.
> >> >>
> >> >> Aaron Meurer
> >> >>
> >> >> --
> >> >> You received this message because you are subscribed to the Google
> Groups "sympy" group.
> >> >> To unsubscribe from this group and stop receiving emails from it,
> send an email to sympy+unsubscr...@googlegroups.com.
> >> >> To post to this group, send email to sympy@googlegroups.com.
> >> >> Visit this group at https://groups.google.com/group/sympy.
> >> >> To view this discussi

Re: [sympy] Benchmarking CI

2019-05-20 Thread Isuru Fernando
On Mon, May 20, 2019 at 3:34 PM Aaron Meurer  wrote:

> Thanks. My biggest question has been how we can do it in the cloud.
> Most CI services run multiple concurrent jobs on the same machine,
> making the performance inconsistent. Does drone.io let you have a
> dedicated machine?
>

Drone.io has a shared cloud offering which we don't want. As you mentioned
we can buy a cheap dedicated machine and install drone on it for free.

Drone might support dedicated machines on the cloud, but I'm not sure.
Travis-CI supports dedicated machines, but we looked at this for
conda-forge and they were quite expensive.


> If we can't do it in the cloud, another alternative would be to buy a
> cheap dedicated machine that we can provision ourselves. We have funds
> in our NumFOCUS account to do either of these, so the question is
> which will be easier for us to set up and maintain. What do the sumpy
> benchmarks run on?
>

It's a dedicated machine somewhere in the university running a gitlab
runner service. Not a cloud machine.

Isuru


> Aaron Meurer
>
> On Mon, May 20, 2019 at 1:59 PM Isuru Fernando  wrote:
> >
> > Hi,
> >
> > I setup asv in Gitlab CI for https://gitlab.tiker.net/inducer/sumpy. It
> runs the PR head and master (cached) and errors if there is a test with 10%
> regression.
> > Script is at
> https://gitlab.tiker.net/inducer/ci-support/blob/master/build-and-benchmark-py-project.sh.
> It runs on a dedicated Gitlab runner.
> >
> > For sympy, you'll have to have a dedicated machine for benchmarking and
> some CI service that integrates with github installed. (Maybe Drone CI
> which is free for 15000 builds per year.
> https://drone.io/enterprise/starter/#features). You'll have to limit to 1
> concurrent job to avoid multiple PRs affecting each other.
> >
> > Isuru
> >
> > On Mon, May 20, 2019 at 1:20 PM Aaron Meurer  wrote:
> >>
> >> Hello everyone.
> >>
> >> I would like to start looking into setting up some kind of
> >> benchmarking CI for SymPy.
> >>
> >> Ideally the CI would work just like Travis or codecov. It would run
> >> the benchmark suite on every pull request, and report if there are any
> >> major performance regressions.
> >>
> >> If anyone has any thoughts on how to go about doing this, let me know.
> >> If anyone knows of any projects that already do this, let me know that
> >> as well.
> >>
> >> Finally, if anyone is interested in helping out with this, please let
> me know.
> >>
> >> Aaron Meurer
> >>
> >> --
> >> You received this message because you are subscribed to the Google
> Groups "sympy" group.
> >> To unsubscribe from this group and stop receiving emails from it, send
> an email to sympy+unsubscr...@googlegroups.com.
> >> To post to this group, send email to sympy@googlegroups.com.
> >> Visit this group at https://groups.google.com/group/sympy.
> >> To view this discussion on the web visit
> https://groups.google.com/d/msgid/sympy/CAKgW%3D6Lks6y8CKbiBRauwD1DQ5%3DcnMzQNbXuhhD9MefbN%3DQQrQ%40mail.gmail.com
> .
> >> For more options, visit https://groups.google.com/d/optout.
> >
> > --
> > You received this message because you are subscribed to the Google
> Groups "sympy" group.
> > To unsubscribe from this group and stop receiving emails from it, send
> an email to sympy+unsubscr...@googlegroups.com.
> > To post to this group, send email to sympy@googlegroups.com.
> > Visit this group at https://groups.google.com/group/sympy.
> > To view this discussion on the web visit
> https://groups.google.com/d/msgid/sympy/CA%2B01voNuyrPRemoJ-3Q0HgucebO4%3DB1g0JScFqs0WwMj3-5odg%40mail.gmail.com
> .
> > For more options, visit https://groups.google.com/d/optout.
>
> --
> You received this message because you are subscribed to the Google Groups
> "sympy" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sympy+unsubscr...@googlegroups.com.
> To post to this group, send email to sympy@googlegroups.com.
> Visit this group at https://groups.google.com/group/sympy.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/sympy/CAKgW%3D6L%3Ddx%3DXpxEH%2BBG%2B9nW%3DaLWceAsyRSv2xD6Zm-iQCHmDLw%40mail.gmail.com
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sympy+unsubscr...@googlegroups.com.
To post to this group, send email to sympy@googlegroups.com.
Visit this group at https://groups.google.com/group/sympy.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/CA%2B01voNzw3ZzZnan-%3DPMeYtGHD7zJ6O9UDrCdPsBMgMCYCi34A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [sympy] Benchmarking CI

2019-05-20 Thread Isuru Fernando
Hi,

I setup asv in Gitlab CI for https://gitlab.tiker.net/inducer/sumpy. It
runs the PR head and master (cached) and errors if there is a test with 10%
regression.
Script is at
https://gitlab.tiker.net/inducer/ci-support/blob/master/build-and-benchmark-py-project.sh.
It runs on a dedicated Gitlab runner.

For sympy, you'll have to have a dedicated machine for benchmarking and
some CI service that integrates with github installed. (Maybe Drone CI
which is free for 15000 builds per year.
https://drone.io/enterprise/starter/#features). You'll have to limit to 1
concurrent job to avoid multiple PRs affecting each other.

Isuru

On Mon, May 20, 2019 at 1:20 PM Aaron Meurer  wrote:

> Hello everyone.
>
> I would like to start looking into setting up some kind of
> benchmarking CI for SymPy.
>
> Ideally the CI would work just like Travis or codecov. It would run
> the benchmark suite on every pull request, and report if there are any
> major performance regressions.
>
> If anyone has any thoughts on how to go about doing this, let me know.
> If anyone knows of any projects that already do this, let me know that
> as well.
>
> Finally, if anyone is interested in helping out with this, please let me
> know.
>
> Aaron Meurer
>
> --
> You received this message because you are subscribed to the Google Groups
> "sympy" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sympy+unsubscr...@googlegroups.com.
> To post to this group, send email to sympy@googlegroups.com.
> Visit this group at https://groups.google.com/group/sympy.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/sympy/CAKgW%3D6Lks6y8CKbiBRauwD1DQ5%3DcnMzQNbXuhhD9MefbN%3DQQrQ%40mail.gmail.com
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sympy+unsubscr...@googlegroups.com.
To post to this group, send email to sympy@googlegroups.com.
Visit this group at https://groups.google.com/group/sympy.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/CA%2B01voNuyrPRemoJ-3Q0HgucebO4%3DB1g0JScFqs0WwMj3-5odg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [sympy] is compatibility builtins broken?

2019-05-08 Thread Isuru Fernando
You can do,

>>> from sympy.core.compatibility import builtins
>>> type = builtins.type

On Wed, May 8, 2019 at 4:42 PM Vishesh Mangla 
wrote:

> What do these builtins ought to be doing?
>
>
>
> Sent from Mail  for
> Windows 10
>
>
>
> *From: *Chris Smith 
> *Sent: *09 May 2019 03:08
> *To: *sympy 
> *Subject: *Re: [sympy] is compatibility builtins broken?
>
>
>
> None of them work
>
>
>
> >>> import sympy.core.compatibility.builtins as builtins
>
> Traceback (most recent call last):
>
>   File "", line 1, in 
>
> ImportError: No module named builtins
>
>
>
> >>> from sympy.core.compatibility.builtins import type
>
> Traceback (most recent call last):
>
>   File "", line 1, in 
>
> ImportError: No module named builtins
>
>
>
> >>> sys.modules['builtins']=__builtin__
>
> Traceback (most recent call last):
>
>   File "", line 1, in 
>
> NameError: name '__builtin__' is not defined
>
>
>
> but
>
>
>
> >>> from __builtin__ import type
>
> >>> 'builtins' in dir()
>
> True
>
> >>> builtins
>
> 
>
> >>> from builtins import type
>
> Traceback (most recent call last):
>
>   File "", line 1, in 
>
> ImportError: No module named builtins
>
>
>
> On Wednesday, May 8, 2019 at 7:34:27 AM UTC-5, Oscar wrote:
>
> On Wed, 8 May 2019 at 08:23, Chris Smith  wrote:
> >
> > Am I doing something wrong here when running Python 2?
> >
> > >>> from sympy.core.compatibility import builtins
> > >>> from builtins import type
> > Traceback (most recent call last):
> >   File "", line 1, in 
> > ImportError: No module named builtins
>
> There are two possible wrong things:
>
> 1) On Python 2 the module is called __builtin__:
>
> >>> import __builtin__
> >>> __builtin__.map
> 
>
> 2) You've imported the name builtins so that it is available as a name
> in the current global namespace. That does not mean that a subsequent
> import statement will import from the resulting module object. An
> import statement never looks at the names in the current namespace to
> find anything. You can however do
>
> import sympy.core.compatbility.builtins as builtins
> builtins.type
>
> Or
>
> from sympy.core.compatibility.builtins import type
>
> Not sure what you're aiming for but there is a hacky way to do it:
>
> sys.modules['builtins'] = builtins
>
> --
> Oscar
>
> --
> You received this message because you are subscribed to the Google Groups
> "sympy" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sympy+unsubscr...@googlegroups.com.
> To post to this group, send email to sympy@googlegroups.com.
> Visit this group at https://groups.google.com/group/sympy.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/sympy/ac4c8667-a1ed-4e96-81e9-5933ffa8685f%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "sympy" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sympy+unsubscr...@googlegroups.com.
> To post to this group, send email to sympy@googlegroups.com.
> Visit this group at https://groups.google.com/group/sympy.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/sympy/5cd34d5c.1c69fb81.a4e7c.0d69%40mx.google.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sympy+unsubscr...@googlegroups.com.
To post to this group, send email to sympy@googlegroups.com.
Visit this group at https://groups.google.com/group/sympy.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/CA%2B01voNeC6or4ommhanwy7Y1n2DPDBnp%2BOd01OMt3L6gWFvotQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [sympy] Re: why eigenvectors very slow

2018-10-09 Thread Isuru Fernando
First k-1 entries of the k th eigenvector for an upper triangular matrix U
is U[:k-1,:k-1]^-1 @ U[:k-1,k], which is a triangular solve since
U[:k-1,:k-1] is a triangular matrix and it can be done in O(k^2) time.

Isuru

On Tue, Oct 9, 2018 at 1:27 PM Jacob Miner  wrote:

> Isuru,
>
> I went into Heath's text to get your reference, and it helps layout the
> method, but can you please clarify what you meant by 'triangular solves'?
>
> Thank you.
>
> On Tue, Oct 9, 2018, 10:45 Aaron Meurer  wrote:
>
>> Your matrix is far simpler than I had imagined (you should have
>> mentioned that it was triangular). I think as Isuru said we can likely
>> implement a faster method for triangular matrices. The eigenvalues
>> themselves (the diagonals) are already computed very quickly.
>>
>> Aaron Meurer
>> On Tue, Oct 9, 2018 at 10:36 AM Isuru Fernando  wrote:
>> >
>> > Hi,
>> >
>> > For triangular matrices, it's straightforward to calculate
>> eigenvectors. You just need triangular solves. See Section 4.4.1 of Heath's
>> Scientific Computing 2nd Edition.
>> >
>> > Isuru
>> >
>> > On Tue, Oct 9, 2018 at 11:27 AM Jacob Miner 
>> wrote:
>> >>
>> >> I will show you a representation of the 7x7 form of my matrix, the
>> 10x10 includes a couple additional elements, but has the same overall
>> structure and layout.
>> >>
>> >> The key point is that the diagonal elements are differences of
>> multiple values, and each of these values occupies a certain element in the
>> lower left of the matrix - the upper right is all 0s. The last two columns
>> are also all 0s.
>> >> It is not really possible to simplify it further.
>> >>
>> >> >>> woVIt =
>> Matrix([[-(k+kcSD),0,0,0,0,0,0],[k,-(kEI+kcED),0,0,0,0,0],[0,kEI,-(kIH+kIR+kcID),0,0,0,0],[0,0,kIH,-(kHHt+kHD+kHR+kcHD),0,0,0],[0,0,0,kHHt,-(kHtD+kHtR),0,0],[kcSD,kcED,kcID,(kHD+kcHD),kHtD,0,0],[0,0,kIR,kHR,kHtR,0,0]])
>> >> >>> woVIt.eigenvals()
>> >> {0: 2, -kIH - kIR - kcID: 1, -kHD - kHHt - kHR - kcHD: 1, -k - kcSD:
>> 1, -kEI - kcED: 1, -kHtD - kHtR: 1}
>> >>
>> >> >>> woVIt.eigenvects()
>> >> [(0, 2, [Matrix([
>> >> [0],
>> >> [0],
>> >> [0],
>> >> [0],
>> >> [0],
>> >> [1],
>> >> [0]]), Matrix([
>> >> [0],
>> >> [0],
>> >> [0],
>> >> [0],
>> >> [0],
>> >> [0],
>> >> [1]])]), (-k - kcSD, 1, [Matrix([
>> >> [
>> -(k + kcSD)*(k - kEI - kcED + kcSD)*(k - kHtD - kHtR + kcSD)*(k - kIH - kIR
>> - kcID + kcSD)*(k - kHD - kHHt - kHR - kcHD + kcSD)/(k*kEI*(kHHt*kHtR*kIH -
>> (kHR*kIH - kIR*(k - kHD - kHHt - kHR - kcHD + kcSD))*(k - kHtD - kHtR +
>> kcSD)))],
>> >> [
>>(k + kcSD)*(k - kHtD - kHtR + kcSD)*(k - kIH -
>> kIR - kcID + kcSD)*(k - kHD - kHHt - kHR - kcHD + kcSD)/(kEI*(kHHt*kHtR*kIH
>> - (kHR*kIH - kIR*(k - kHD - kHHt - kHR - kcHD + kcSD))*(k - kHtD - kHtR +
>> kcSD)))],
>> >> [
>>   -(k +
>> kcSD)*(k - kHtD - kHtR + kcSD)*(k - kHD - kHHt - kHR - kcHD +
>> kcSD)/(kHHt*kHtR*kIH - (kHR*kIH - kIR*(k - kHD - kHHt - kHR - kcHD +
>> kcSD))*(k - kHtD - kHtR + kcSD))],
>> >> [
>>
>> kIH*(k + kcSD)*(k - kHtD - kHtR + kcSD)/(kHHt*kHtR*kIH
>> - (kHR*kIH - kIR*(k - kHD - kHHt - kHR - kcHD + kcSD))*(k - kHtD - kHtR +
>> kcSD))],
>> >> [
>>
>>-kHHt*kIH*(k + kcSD)/(kHHt*kHtR*kIH
>> - (kHR*kIH - kIR*(k - kHD - kHHt - kHR - kcHD + kcSD))*(k - kHtD - kHtR +
>> kcSD))],
>> >> [(k*kEI*kHHt*kHtD*kIH - (k*kEI*kIH*(kHD + kcHD) - (k*kEI*kcID -
>> (k*kcED - kcSD*(k - kEI - kcED + kcSD))*(k - kIH - kIR - kcID + kcSD))*(k -
>> kHD - kHHt - kHR - kcHD + kcSD))*(k - kHtD - kHtR +
>> kcSD))/(k*kEI*(kHHt*kHtR*kIH - (kHR*kIH - kIR*(k - kHD - kHHt - kHR - kcHD
>> + kcSD))*(k - kHtD - kHtR + kcSD)))],
>> >> [
>>
>>
>>
>>   1]])]), (-kEI - kcED, 1, [Matrix([
>> >> [
>>
>>
>>
>>
>>   0],
>> >> [
>>
>>(kEI + kcED)*(kEI - kHtD - kHtR + kcED)*(kEI
>> - kIH - kIR + kcED - kcID)*(kEI - kHD - kHHt - kHR + kcED -
>> kcHD)/(kEI*(kHHt*kHtR*kIH - (kHR*kIH - kIR*(kEI - kHD - kHHt - kHR + kcED -
>> kcHD))*(kEI - kHtD - kHtR + kcED)))],
>> >> [
>>
>>  

Re: [sympy] Re: why eigenvectors very slow

2018-10-09 Thread Isuru Fernando
Hi,

For triangular matrices, it's straightforward to calculate eigenvectors.
You just need triangular solves. See Section 4.4.1 of Heath's Scientific
Computing 2nd Edition.

Isuru

On Tue, Oct 9, 2018 at 11:27 AM Jacob Miner  wrote:

> I will show you a representation of the 7x7 form of my matrix, the 10x10
> includes a couple additional elements, but has the same overall structure
> and layout.
>
> The key point is that the diagonal elements are differences of multiple
> values, and each of these values occupies a certain element in the lower
> left of the matrix - the upper right is all 0s. The last two columns are
> also all 0s.
> It is not really possible to simplify it further.
>
> >>> woVIt =
> Matrix([[-(k+kcSD),0,0,0,0,0,0],[k,-(kEI+kcED),0,0,0,0,0],[0,kEI,-(kIH+kIR+kcID),0,0,0,0],[0,0,kIH,-(kHHt+kHD+kHR+kcHD),0,0,0],[0,0,0,kHHt,-(kHtD+kHtR),0,0],[kcSD,kcED,kcID,(kHD+kcHD),kHtD,0,0],[0,0,kIR,kHR,kHtR,0,0]])
> >>> woVIt.eigenvals()
> {0: 2, -kIH - kIR - kcID: 1, -kHD - kHHt - kHR - kcHD: 1, -k - kcSD: 1,
> -kEI - kcED: 1, -kHtD - kHtR: 1}
>
> >>> woVIt.eigenvects()
> [(0, 2, [Matrix([
> [0],
> [0],
> [0],
> [0],
> [0],
> [1],
> [0]]), Matrix([
> [0],
> [0],
> [0],
> [0],
> [0],
> [0],
> [1]])]), (-k - kcSD, 1, [Matrix([
> [  -(k
> + kcSD)*(k - kEI - kcED + kcSD)*(k - kHtD - kHtR + kcSD)*(k - kIH - kIR -
> kcID + kcSD)*(k - kHD - kHHt - kHR - kcHD + kcSD)/(k*kEI*(kHHt*kHtR*kIH -
> (kHR*kIH - kIR*(k - kHD - kHHt - kHR - kcHD + kcSD))*(k - kHtD - kHtR +
> kcSD)))],
> [
> (k + kcSD)*(k - kHtD - kHtR + kcSD)*(k - kIH - kIR - kcID + kcSD)*(k - kHD
> - kHHt - kHR - kcHD + kcSD)/(kEI*(kHHt*kHtR*kIH - (kHR*kIH - kIR*(k - kHD -
> kHHt - kHR - kcHD + kcSD))*(k - kHtD - kHtR + kcSD)))],
> [
> -(k + kcSD)*(k - kHtD - kHtR + kcSD)*(k - kHD - kHHt - kHR - kcHD +
> kcSD)/(kHHt*kHtR*kIH - (kHR*kIH - kIR*(k - kHD - kHHt - kHR - kcHD +
> kcSD))*(k - kHtD - kHtR + kcSD))],
> [
> kIH*(k + kcSD)*(k - kHtD - kHtR + kcSD)/(kHHt*kHtR*kIH - (kHR*kIH - kIR*(k
> - kHD - kHHt - kHR - kcHD + kcSD))*(k - kHtD - kHtR + kcSD))],
> [
> -kHHt*kIH*(k + kcSD)/(kHHt*kHtR*kIH - (kHR*kIH - kIR*(k - kHD - kHHt - kHR
> - kcHD + kcSD))*(k - kHtD - kHtR + kcSD))],
> [(k*kEI*kHHt*kHtD*kIH - (k*kEI*kIH*(kHD + kcHD) - (k*kEI*kcID - (k*kcED -
> kcSD*(k - kEI - kcED + kcSD))*(k - kIH - kIR - kcID + kcSD))*(k - kHD -
> kHHt - kHR - kcHD + kcSD))*(k - kHtD - kHtR + kcSD))/(k*kEI*(kHHt*kHtR*kIH
> - (kHR*kIH - kIR*(k - kHD - kHHt - kHR - kcHD + kcSD))*(k - kHtD - kHtR +
> kcSD)))],
> [
> 1]])]), (-kEI - kcED, 1, [Matrix([
> [
> 0],
> [
> (kEI + kcED)*(kEI - kHtD - kHtR + kcED)*(kEI - kIH - kIR + kcED -
> kcID)*(kEI - kHD - kHHt - kHR + kcED - kcHD)/(kEI*(kHHt*kHtR*kIH - (kHR*kIH
> - kIR*(kEI - kHD - kHHt - kHR + kcED - kcHD))*(kEI - kHtD - kHtR + kcED)))],
> [
> -(kEI + kcED)*(kEI - kHtD - kHtR + kcED)*(kEI - kHD - kHHt - kHR + kcED -
> kcHD)/(kHHt*kHtR*kIH - (kHR*kIH - kIR*(kEI - kHD - kHHt - kHR + kcED -
> kcHD))*(kEI - kHtD - kHtR + kcED))],
> [
> kIH*(kEI + kcED)*(kEI - kHtD - kHtR + kcED)/(kHHt*kHtR*kIH - (kHR*kIH -
> kIR*(kEI - kHD - kHHt - kHR + kcED - kcHD))*(kEI - kHtD - kHtR + kcED))],
> [
> -kHHt*kIH*(kEI + kcED)/(kHHt*kHtR*kIH - (kHR*kIH - kIR*(kEI - kHD - kHHt -
> kHR + kcED - kcHD))*(kEI - kHtD - kHtR + kcED))],
> [(kEI*kHHt*kHtD*kIH*(-k + kEI + kcED - kcSD) - (kEI*kIH*(kHD + kcHD)*(-k +
> kEI + kcED - kcSD) - (kEI*kcID*(-k + kEI + kcED - kcSD) - kcED*(-k + kEI +
> kcED - kcSD)*(kEI - kIH - kIR + kcED - kcID))*(kEI - kHD - kHHt - kHR +
> kcED - kcHD))*(kEI - kHtD - kHtR + kcED))/(kEI*(kHHt*kHtR*kIH - (kHR*kIH -
> kIR*(kEI - kHD - kHHt - kHR + kcED - kcHD))*(kEI - kHtD - kHtR + kcED))*(-k
> + kEI + kcED - kcSD))],
> [
> 1]])]), (-kHtD - kHtR, 1, [Matrix([
> [  0],
> [  0],
> [  0],
> [  0],
> [-(kHtD + kHtR)/kHtR],
> [  kHtD/kHtR],
> [  1]])]), (-kIH - kIR - kcID, 1, [Matrix([
> [
> 0],
> [
> 0],
> [
> -(kIH + kIR + kcID)*(-kHtD - kHtR + kIH + kIR + kcID)*(-kHD - kHHt - kHR +
> kIH + kIR - kcHD + kcID)/(kHHt*kHtR*kIH - (kHR*kIH - kIR*(-kHD - kHHt - kHR
> + kIH + kIR - kcHD + kcID))*(-kHtD - kHtR + kIH + kIR + kcID))],
> [
> kIH*(kIH + kIR + kcID)*(-kHtD - kHtR + kIH + kIR + kcID)/(kHHt*kHtR*kIH -
> (kHR*kIH - kIR*(-kHD - kHHt - kHR + kIH + kIR - kcHD + kcID))*(-kHtD - kHtR
> + kIH + kIR + kcID))],
> [
> -kHHt*kIH*(kIH + kIR + kcID)/(kHHt*kHtR*kIH - (kHR*kIH - kIR*(-kHD - kHHt -
> kHR + kIH + kIR - kcHD + kcID))*(-kHtD - kHtR + kIH + kIR + kcID))],
> [(kHHt*kHtD*kIH*(-k + kIH + kIR + kcID - kcSD)**2*(-kEI + kIH + kIR - kcED
> + kcID) - (kIH*(kHD + kcHD)*(-k + kIH + kIR + kcID - kcSD)**2*(-kEI + kIH +
> kIR - kcED + kcID) - kcID*(-k + kIH + kIR + kcID - kcSD)**2*(-kEI + kIH +
> kIR - kcED + kcID)*(-kHD - kHHt - kHR + kIH + kIR - kcHD + kcID))*(-kHtD -
> kHtR + kIH + kIR + kcID))/((kHHt*kHtR*kIH - (kHR*kIH - kIR*(-kHD - kHHt -
> kHR + kIH + kIR - kcHD + kcID))*(-kHtD - kHtR + kIH + kIR 

Re: [sympy] Error? Mpmath Bound Method

2018-05-17 Thread Isuru Fernando
Hi,

Without seeing your code or the full output, I can't say anything. See
https://stackoverflow.com/help/mcve

sympy is provided "as is" and the developers cannot say that you should
trust it. See https://github.com/sympy/sympy/blob/master/LICENSE#L18-L21

Isuru

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sympy+unsubscr...@googlegroups.com.
To post to this group, send email to sympy@googlegroups.com.
Visit this group at https://groups.google.com/group/sympy.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/CA%2B01voO%3Dz2GYb-ZnCEL6%3DTQs2k%2BwvZKoKcy%3DSMvDxVvQCX1%2BuA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [sympy] is something wrong with evaluation of Rationals?

2018-03-30 Thread Isuru Fernando
Part of it is a bug and part of it is a feature.

First the bug, https://github.com/sympy/sympy/blob/7524499458cf114b32e
3aa6e8acdb77e846111f9/sympy/core/evalf.py#L1264 needs to be changed. It
should be changed from from_rational(x.p, x.q, prec) to from_rational(x.p,
x.q, prec, rnd). Otherwise round down is used instead of round nearest.

This doesn't affect much though. same phenomena happens at 5128 instead of
5158.

Now for the feature part.
a.n(2) doesn't guarantee you that the result will be rounded nearest to 2
decimal digits. a.n(2) only guarantees that the internal representation of
|a-a.n(2)|  < 0.5e-2.

Here's what sympy does.
dps = 2 (digits) is converted to prec=10 (bits)
.n routine first evaluates the rational with prec+4 bits and then rounds
the result.

Larger rational is rounded to   p=15977*2**-14 = 0.9751586914...
Smaller rational is rounded to  q=15966*2**-14 = 0.9750976563...

In the round down case 5159 is rounded down to p and 5158 is rounded down
to q
In the round to nearest case 5129 is rounded to p while 5128 is rounded to
q.

Then sympy normalizes these mpfs to 10 bits.

There are now 2 choices
Larger float is rounded nearest to   r = 997*2**-10 = 0.9755859375
Smaller float is rounded nearest to s = 996*2**-10 = 0.9746093750

These two are the results you get, but SymPy prints only 2 decimal digits
of the numbers and therefore prints 0.98 for the larger and 0.97 for the
smaller.

There was a similar discussion in issue
https://github.com/sympy/sympy/issues/12038

Isuru

On Fri, Mar 30, 2018 at 1:37 AM, Chris Smith  wrote:

> Is this expected behavior for evaluating Rationals:
>
> Rational of a string produces the exact decimal as a fraction:
>
> >>> Rational('.975159')
> 975159/100
>
> evaluation is going to be affected by rounding
>
> >>> Rational('.975158').n(2)
> 0.97
> >>> Rational('.975159').n(2)
> 0.98
>
> But why is the digit affecting rounding in the 6th decimal position when
> we are trying to evaluate to the 2nd position? And I would have expected
> the split to be much closer to 5000 than 5158.
>
> /c
>
> --
> You received this message because you are subscribed to the Google Groups
> "sympy" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sympy+unsubscr...@googlegroups.com.
> To post to this group, send email to sympy@googlegroups.com.
> Visit this group at https://groups.google.com/group/sympy.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/sympy/f9dc2400-5277-4ed1-ad80-00fa5b12bd6e%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sympy+unsubscr...@googlegroups.com.
To post to this group, send email to sympy@googlegroups.com.
Visit this group at https://groups.google.com/group/sympy.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/CA%2B01voNNwgV9UhUcyPL37K1DSs6PrdiJBa7oPTxN-dO4EYYp5g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [sympy] [Proposal] Mutable expressions in SymPy

2018-03-24 Thread Isuru Fernando
On Sat, Mar 24, 2018 at 11:16 AM, Aaron Meurer  wrote:

> Assumedly the point of this is for performance, so that something like
> (x + y + z) + w doesn't require rebuilding x + y + z.
>
> I've thought for some time that Add should save its coeff: term
> dictionary, to make further additions faster. I'm not sure if this
> requires mutability.
>

That's exactly what symengine does. It keeps the internal dictionary
structure and uses the dictionary. This makes .args a bit slower in
symengine, but with caching that should go away. Note that you'd need a
dictionary and a vector to keep the non-commutative and unevalauted objects.

Isuru


> I believe mutability can work for builder classes, but it requires
> very careful bookkeeping, to invalidate anything pointing to it once
> it mutates. And as you noted, it can't be included in the hash of any
> mutable object. So in general, the mutable builder should be
> considered a cached preprocessing step. If it exists, and hasn't been
> invalidated, it can be used. Otherwise, it should be rebuilt from
> scratch.
>
> Aaron Meurer
>
> On Sat, Mar 24, 2018 at 11:28 AM, Francesco Bonazzi
>  wrote:
> > I was considering the possibility of mutable expressions in SymPy.
> >
> > Currently expressions such as Add and Mul are immutable once the class
> > constructor has been called and modifying their content requires the
> object
> > to be re-built.
> >
> > I have tried to write a draft to implement the builder pattern, for
> example
> > with an AddBuilder object:
> > https://github.com/Upabjojr/sympy/blob/f4e26d9a7314ad5093b97c7e84a581
> f523d38efb/sympy/core/dispatchers_add.py#L8
> >
> > The builder class is mutable and would be added elements until it is
> passed
> > to some method that builds the underlying class, Add in this case.
> >
> > At this point construction of objects could be done through multiple
> > dispatching an append method to the builder class. Unfortunately this
> makes
> > everything much more complicated, as every object that potentially needs
> to
> > subclass __add__ could potentially need its own builder object.
> >
> > There have been other attempts at creating mutable corresponding objects,
> > e.g.:
> > https://github.com/sympy/sympy/blob/master/sympy/unify/core.py#L24
> >
> > Unfortunately once the SymPy expression is deconstructed, it remains
> > unusable.
> >
> > Proposal:what about allowing SymPy objects to exist in a mutable state?
> For
> > example, introduce a mutable=False option to Basic, so that if mutable is
> > set to True, there could be a way to edit the args.
> >
> > There could be potential problems with the hashing. One possible solution
> > could be not to allow immutable objects to contain mutable ones.
> >
> > --
> > You received this message because you are subscribed to the Google Groups
> > "sympy" group.
> > To unsubscribe from this group and stop receiving emails from it, send an
> > email to sympy+unsubscr...@googlegroups.com.
> > To post to this group, send email to sympy@googlegroups.com.
> > Visit this group at https://groups.google.com/group/sympy.
> > To view this discussion on the web visit
> > https://groups.google.com/d/msgid/sympy/ecc4eaa9-28dc-
> 44a4-9ed0-402adea432e5%40googlegroups.com.
> > For more options, visit https://groups.google.com/d/optout.
>
> --
> You received this message because you are subscribed to the Google Groups
> "sympy" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sympy+unsubscr...@googlegroups.com.
> To post to this group, send email to sympy@googlegroups.com.
> Visit this group at https://groups.google.com/group/sympy.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/sympy/CAKgW%3D6JiU_Qixnk3Eon8P_rBwxUNf5gs%
> 2BiFEcWmM3%3DYC_eTYxg%40mail.gmail.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sympy+unsubscr...@googlegroups.com.
To post to this group, send email to sympy@googlegroups.com.
Visit this group at https://groups.google.com/group/sympy.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/CA%2B01voMQ_G99SXv2iUpc8ofQjeaC0qiF7jAtiakVToZ-pEHcww%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [sympy] digital logarithm

2018-01-11 Thread Isuru Fernando
Discrete logarithm has no "efficient solution" in general. For example
finding `y = x**n mod m` (i.e. in the set of integers modulo `m`) is hard,
but finding the discrete logarithm in the set of integers is easy.

Isuru

On Thu, Jan 11, 2018 at 4:35 PM, Chris Smith  wrote:

> I was inspired to dig a little deeper into the issue raised in PR #13844,
> finding the exponent of integer `x` in `y`, More specifically, finding
> whether `y` is exactly `x**n`. I read here
>  that this problem has
> "no efficient solution". But I must be missing something, because if (in
> SymPy) we write `integer_log = lambda y, x: multiplicity(x, y)` that runs
> as the square of the number of digits of y. Although multiplicity doesn't
> exactly give what we are looking for it is not hard to modify it so it does
> (and it runs in `O(d**2)` where d is the number of digits)...am I
> misunderstanding something about the complexity measure or the nature of
> the problem?
>
> /c
>
> --
> You received this message because you are subscribed to the Google Groups
> "sympy" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sympy+unsubscr...@googlegroups.com.
> To post to this group, send email to sympy@googlegroups.com.
> Visit this group at https://groups.google.com/group/sympy.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/sympy/21b9003c-0baf-4295-ac3a-114be0b849d4%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sympy+unsubscr...@googlegroups.com.
To post to this group, send email to sympy@googlegroups.com.
Visit this group at https://groups.google.com/group/sympy.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/CA%2B01voMsS4yvEOVivQzq8kB2Qm2rD-KKP1tT9XFefuWNzOA%2BrQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [sympy] Re: mpmath 1.0

2017-10-02 Thread Isuru Fernando
It's packaged as "libflint" (
https://github.com/conda-forge/libflint-feedstock) due to "flint" being a
python package in PyPI

Isuru

On Mon, Oct 2, 2017 at 2:42 PM, Aaron Meurer <asmeu...@gmail.com> wrote:

> I didn't see FLINT when I searched the feedstocks
> https://github.com/conda-forge?utf8=%E2%9C%93=flint==
>
> Aaron Meurer
>
> On Mon, Oct 2, 2017 at 3:37 PM, Isuru Fernando <isu...@gmail.com> wrote:
> >> I think getting FLINT and python-flint on conda-forge would help a
> >> lot, as it would make it much easier for most people to install it.
> >
> >
> > FLINT and Arb are both on conda-forge for Linux and OSX. (For windows,
> I'm
> > waiting for the next flint release). You just need to package
> `python-flint`
> >
> >
> > Isuru Fernando
> >
> > --
> > You received this message because you are subscribed to the Google Groups
> > "sympy" group.
> > To unsubscribe from this group and stop receiving emails from it, send an
> > email to sympy+unsubscr...@googlegroups.com.
> > To post to this group, send email to sympy@googlegroups.com.
> > Visit this group at https://groups.google.com/group/sympy.
> > To view this discussion on the web visit
> > https://groups.google.com/d/msgid/sympy/CA%2B01voPwcr%
> 2BcDDgWNTutT04Afaz-VxmtrebgBVQuBPYgW-dAbQ%40mail.gmail.com.
> >
> > For more options, visit https://groups.google.com/d/optout.
>
> --
> You received this message because you are subscribed to the Google Groups
> "sympy" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sympy+unsubscr...@googlegroups.com.
> To post to this group, send email to sympy@googlegroups.com.
> Visit this group at https://groups.google.com/group/sympy.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/sympy/CAKgW%3D6KM3eBGyKR%2BeZF7r_FczLzEpG1t8sko_R2U_t8BH4w%
> 2BiQ%40mail.gmail.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sympy+unsubscr...@googlegroups.com.
To post to this group, send email to sympy@googlegroups.com.
Visit this group at https://groups.google.com/group/sympy.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/CA%2B01voNtVy01_cYmsP3Hset5ysFiLhorJrckzg2_nLefiw5p5A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [sympy] Re: mpmath 1.0

2017-10-02 Thread Isuru Fernando
>
> I think getting FLINT and python-flint on conda-forge would help a
> lot, as it would make it much easier for most people to install it.
>

FLINT and Arb are both on conda-forge for Linux and OSX. (For windows, I'm
waiting for the next flint release). You just need to package `python-flint`


Isuru Fernando

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sympy+unsubscr...@googlegroups.com.
To post to this group, send email to sympy@googlegroups.com.
Visit this group at https://groups.google.com/group/sympy.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/CA%2B01voPwcr%2BcDDgWNTutT04Afaz-VxmtrebgBVQuBPYgW-dAbQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [sympy] MPZ related error: where to start investigations?

2017-06-29 Thread Isuru Fernando
On Thu, Jun 29, 2017 at 5:43 PM, Antoine Falaize <antoine.fala...@gmail.com>
wrote:

> Thank you for your investigations!
>
> So, as far as I understand: this error is related to the use of the mpmath
> gmpy backend, and has been corrected.
>
> But, currently, this makes a large part of pyphs unusable for a small set
> of platforms, and I do not understand:
> (i) the reason for certain platforms to raise this error, while other
> won't (we never explicitely specify any backend in pyphs, and do not point
> any specific version of sympy);
>

This happens when gmpy is installed only. (SymPy detects whether gmpy is
installed and uses gmpy)


> (ii) if this fix is already merged in the current sympy master, or if it
> will be in a future release.
>

This is fixed in sympy master and will be in the next release

Isuru Fernando

>
> Can we do anything to help?
>
>
> Le mercredi 28 juin 2017 21:57:54 UTC+2, Aaron Meurer a écrit :
>>
>> I don't think the fix was accidental. See
>> https://github.com/sympy/sympy/pull/11862/commits/8a7e079920
>> 35f05780ebc33b4ffbf72d32a83069.
>> From the commit message, "Also modify mpf_norm to handle non-mpz input
>> when the mpmath gmpy backend is
>> used."
>>
>> Your Point example doesn't fail for me in master.
>>
>> Aaron Meurer
>>
>> On Wed, Jun 28, 2017 at 8:02 AM, Isuru Fernando <isu...@gmail.com>
>> wrote:
>> > From reproduce I meant a similar error (didn't check pyphs)
>> >
>> > from sympy import Point
>> > import pickle
>> > pickle.loads(pickle.dumps(Point(1.1, 2.1).evalf()))
>> >
>> >
>> > Isuru Fernando
>> >
>> > On Wed, Jun 28, 2017 at 5:28 PM, Isuru Fernando <isu...@gmail.com>
>> wrote:
>> >>
>> >> I can reproduce with gmpy2 and sympy=1.0, but goes away if I remove
>> gmpy2
>> >> or update to sympy master. This was fixed accidentally in
>> >> https://github.com/sympy/sympy/pull/11862
>> >>
>> >>
>> >> Isuru Fernando.
>> >
>> >
>> > --
>> > You received this message because you are subscribed to the Google
>> Groups
>> > "sympy" group.
>> > To unsubscribe from this group and stop receiving emails from it, send
>> an
>> > email to sympy+un...@googlegroups.com.
>> > To post to this group, send email to sy...@googlegroups.com.
>> > Visit this group at https://groups.google.com/group/sympy.
>> > To view this discussion on the web visit
>> > https://groups.google.com/d/msgid/sympy/CA%2B01voM9aDxDcb5HP
>> 8vRbj8jFpDXT3wm7KMo0RV2SqeHB7bm5w%40mail.gmail.com.
>> >
>> > For more options, visit https://groups.google.com/d/optout.
>>
> --
> You received this message because you are subscribed to the Google Groups
> "sympy" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sympy+unsubscr...@googlegroups.com.
> To post to this group, send email to sympy@googlegroups.com.
> Visit this group at https://groups.google.com/group/sympy.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/sympy/c3651984-89af-42e7-bf5c-b6e0ce367dc1%40googlegroups.com
> <https://groups.google.com/d/msgid/sympy/c3651984-89af-42e7-bf5c-b6e0ce367dc1%40googlegroups.com?utm_medium=email_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sympy+unsubscr...@googlegroups.com.
To post to this group, send email to sympy@googlegroups.com.
Visit this group at https://groups.google.com/group/sympy.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/CA%2B01voOZs6DAOpPeGXcn3hbmhd6iSMs9eYv8i2oa33LkSZbG%2BA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [sympy] MPZ related error: where to start investigations?

2017-06-28 Thread Isuru Fernando
>From reproduce I meant a similar error (didn't check pyphs)

from sympy import Point
import pickle
pickle.loads(pickle.dumps(Point(1.1, 2.1).evalf()))


Isuru Fernando

On Wed, Jun 28, 2017 at 5:28 PM, Isuru Fernando <isu...@gmail.com> wrote:

> I can reproduce with gmpy2 and sympy=1.0, but goes away if I remove gmpy2
> or update to sympy master. This was fixed accidentally in
> https://github.com/sympy/sympy/pull/11862
>
>
> Isuru Fernando.
>

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sympy+unsubscr...@googlegroups.com.
To post to this group, send email to sympy@googlegroups.com.
Visit this group at https://groups.google.com/group/sympy.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/CA%2B01voM9aDxDcb5HP8vRbj8jFpDXT3wm7KMo0RV2SqeHB7bm5w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [sympy] MPZ related error: where to start investigations?

2017-06-28 Thread Isuru Fernando
I can reproduce with gmpy2 and sympy=1.0, but goes away if I remove gmpy2
or update to sympy master. This was fixed accidentally in
https://github.com/sympy/sympy/pull/11862


Isuru Fernando.

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sympy+unsubscr...@googlegroups.com.
To post to this group, send email to sympy@googlegroups.com.
Visit this group at https://groups.google.com/group/sympy.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/CA%2B01voOYxczczz1R_qJ79cm9YCQWgnM6P%2B2-uQp9e-nOub3oCw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [sympy] Re: GSoC Students announced

2017-05-12 Thread Isuru Fernando
I created https://gitter.im/sympy/codegen-gsoc17

On Fri, May 12, 2017 at 6:54 PM, Björn Dahlgren  wrote:

>
>
> On Friday, 12 May 2017 00:20:49 UTC+2, Aaron Meurer wrote:
>>
>> Maybe you have to have admin access to do it. Can you tell me the name
>> of the room you want to create?
>>
>
> It seems like I can't create a room (or I am simply failing to figure out
> how to do so).
> Could you add a room called "codegen-gsoc17"?
>
> Björn Dahlgren
>
> --
> You received this message because you are subscribed to the Google Groups
> "sympy" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sympy+unsubscr...@googlegroups.com.
> To post to this group, send email to sympy@googlegroups.com.
> Visit this group at https://groups.google.com/group/sympy.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/sympy/3c28b162-9383-46d5-b46e-c1c3537f0b85%40googlegroups.com
> 
> .
>
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sympy+unsubscr...@googlegroups.com.
To post to this group, send email to sympy@googlegroups.com.
Visit this group at https://groups.google.com/group/sympy.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/CA%2B01voMtpgUz6gTHBfrEFXHe_rDU8%2BMJSXFvbJuzTY5-R-Xb5A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[sympy] GSoC ideas - Using SymEngine in SymPy

2017-01-20 Thread Isuru Fernando
Initial proof of concept that SymEngine can be used in SymPy with little
effort, is here https://github.com/sympy/sympy/pull/11002. This was for
sympy.physics.mechanics submodule only.  Basically you can use SymEngine as
the symbolic backend for all the functions in sympy.physics.mechanics
instead of SymPy's core by setting a environment variable.

I'd be interested in mentoring a project that expands the submodules that
can use SymEngine as its backend.

Anybody got any ideas on what submodules can benefit from SymEngine? Some
criterias are,
1. Doesn't involve assumptions or integration. (SymEngine doesn't have
those yet.)
2. SymPy is not fast enough for your application and there are benchmarks
we can use.


Isuru Fernando

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sympy+unsubscr...@googlegroups.com.
To post to this group, send email to sympy@googlegroups.com.
Visit this group at https://groups.google.com/group/sympy.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/CA%2B01voOMvSku9cW8S%3DRSsXc_wCdLxKeBtZ%3DgvhQO4-caqsupRw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [sympy] Re: Doing a release

2017-01-12 Thread Isuru Fernando
Same topic came up on sage-devel today with a solution.

https://groups.google.com/forum/m/#!topic/sage-devel/81qsOpoOKMM


Isuru Fernando

On Jan 12, 2017 5:30 AM, "Aaron Meurer" <asmeu...@gmail.com> wrote:

> So let's figure out how they do it. Does someone do it by hand, or do
> they just deal with the conflicts somehow?
>
> I'm +1 to doing this somehow, because the current process isn't
> working. We either need a process wherein everyone updates the release
> notes with their pull requests (has to be done at the same time or
> people won't do it), or just deal with release notes that are
> generated automatically (I believe this is what the IPython/Jupyter
> guys do).
>
> Aaron Meurer
>
> On Wed, Jan 11, 2017 at 4:55 PM, Jason Moore <moorepa...@gmail.com> wrote:
> > SciPy does it too: https://github.com/scipy/
> scipy/tree/master/doc/release
> > and the notes seem quite comprehensive and well organized.
> >
> > To avoid merge conflicts we could require a single file for each item in
> the
> > notes to be added and then a script compiles the full note set from
> those.
> >
> >
> > Jason
> > moorepants.info
> > +01 530-601-9791
> >
> > On Wed, Jan 11, 2017 at 10:20 AM, Aaron Meurer <asmeu...@gmail.com>
> wrote:
> >>
> >> Do you know how pandas generates those files? Are they generated
> >> programmatically or by hand? Usually having a single file for release
> >> notes gets to be a nightmare because of the merge conflicts.
> >>
> >> Aaron Meurer
> >>
> >> On Wed, Jan 11, 2017 at 1:46 AM, Shekhar Prasad Rajak
> >> <shekharrajak.1...@gmail.com> wrote:
> >> > I think, it will be easy during the new release to see the changes in
> >> > one
> >> > file, if we add a file in SymPy repo and keep updating it whenever
> >> > something
> >> > added/modified (Before merging PR). Something like this :
> >> > https://github.com/pandas-dev/pandas/tree/master/doc/source/whatsnew
> >> >
> >> > --
> >> > Shekhar
> >> >
> >> > On Monday, 26 September 2016 22:43:16 UTC+5:30, Aaron Meurer wrote:
> >> >>
> >> >> Now that GSoC has wrapped up, we should start looking at doing a
> >> >> release.
> >> >> As a start, can people
> >> >>
> >> >> - Mark issues and pull requests that need to be completed before the
> >> >> release with the "SymPy 1.1" milestone
> >> >>
> >> >> - Update the release notes with changes that have been merged
> >> >> https://github.com/sympy/sympy/wiki/Release-Notes-for-1.1
> >> >>
> >> >> Any help you can provide on the above two points (especially the
> >> >> release
> >> >> notes) would be greatly appreciated.
> >> >>
> >> >> Aaron Meurer
> >> >
> >> > --
> >> > You received this message because you are subscribed to the Google
> >> > Groups
> >> > "sympy" group.
> >> > To unsubscribe from this group and stop receiving emails from it, send
> >> > an
> >> > email to sympy+unsubscr...@googlegroups.com.
> >> > To post to this group, send email to sympy@googlegroups.com.
> >> > Visit this group at https://groups.google.com/group/sympy.
> >> > To view this discussion on the web visit
> >> >
> >> > https://groups.google.com/d/msgid/sympy/a3f4a6c5-8a9c-
> 4560-b81b-0841323a8267%40googlegroups.com.
> >> >
> >> > For more options, visit https://groups.google.com/d/optout.
> >>
> >> --
> >> You received this message because you are subscribed to the Google
> Groups
> >> "sympy" group.
> >> To unsubscribe from this group and stop receiving emails from it, send
> an
> >> email to sympy+unsubscr...@googlegroups.com.
> >> To post to this group, send email to sympy@googlegroups.com.
> >> Visit this group at https://groups.google.com/group/sympy.
> >> To view this discussion on the web visit
> >> https://groups.google.com/d/msgid/sympy/CAKgW%
> 3D6KnzE2nuGdmovQqs9UtDdPoZb-DHuAp2ReukURE2u8NKw%40mail.gmail.com.
> >> For more options, visit https://groups.google.com/d/optout.
> >
> >
> > --
> > You received this message because you are subscribed to the Google Groups
> > "sympy" group.
> > To unsubscribe from this group and stop receiving emails from it, sen

Re: [sympy] How to simplify -polylog(2, exp_polar(I*pi))/16 + pi**2/96 ?

2016-12-02 Thread Isuru Fernando
It does give me the correct answer in the latest master, but I get the same
incorrect answer in sympy-1.0. It was fixed here,
https://github.com/sympy/sympy/pull/10799


Isuru Fernando

On Fri, Dec 2, 2016 at 6:48 PM, Sébastien Labbé <sla...@gmail.com> wrote:

> Ok, thank you. I see:
>
> >>> from sympy import *
> >>> -polylog(2, exp_polar(I*pi))/16 + pi**2/96
> -polylog(2, exp_polar(I*pi))/16 + pi**2/96
> >>> exp_polar(I*pi)
> exp_polar(I*pi)
>
> Then should not this gives me pi**2/64 ?
>
> >>> -polylog(2, -1)/16 + pi**2/96
> pi**2/192
>
> --
> You received this message because you are subscribed to the Google Groups
> "sympy" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sympy+unsubscr...@googlegroups.com.
> To post to this group, send email to sympy@googlegroups.com.
> Visit this group at https://groups.google.com/group/sympy.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/sympy/dc8bd40d-c208-45aa-b4d2-8681df0d0923%40googlegroups.com
> <https://groups.google.com/d/msgid/sympy/dc8bd40d-c208-45aa-b4d2-8681df0d0923%40googlegroups.com?utm_medium=email_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sympy+unsubscr...@googlegroups.com.
To post to this group, send email to sympy@googlegroups.com.
Visit this group at https://groups.google.com/group/sympy.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/CA%2B01voOQJg24N%2BFczmWz14rJMqG2hzp2O6ZBX2Ws_hNF%3DKhG%3Dw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [sympy] How to simplify -polylog(2, exp_polar(I*pi))/16 + pi**2/96 ?

2016-12-02 Thread Isuru Fernando
This is a known bug, https://github.com/sympy/sympy/issues/8404

A._sage_() works because exp_polar(I*pi) is -1 in sage and is unevaluated
in SymPy.


Isuru Fernando

On Fri, Dec 2, 2016 at 2:55 PM, Sébastien Labbé <sla...@gmail.com> wrote:

> Can SymPy tell me that A = 1/64*pi**2 by simplifying the polylog in below
> example?
>
> >>> from sympy.abc import n
> >>> from sympy import summation, oo
> >>> A = summation(1/((2*n+1)^2-4)^2, (n, 0, oo))
> >>> A
> -polylog(2, exp_polar(I*pi))/16 + pi**2/96
> >>> A.simplify()
> -polylog(2, exp_polar(I*pi))/16 + pi**2/96
>
> because it seems doable:
>
> sage: from sympy.abc import n
> sage: from sympy import summation, oo
> sage: A = summation(1/((2*n+1)^2-4)^2, (n, 0, oo))
> sage: A._sage_()
> 1/64*pi^2
>
> This came up in https://ask.sagemath.org/question/35839/sage-
> incorrectly-evaluates-series/
>
> Sébastien
>
> --
> You received this message because you are subscribed to the Google Groups
> "sympy" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sympy+unsubscr...@googlegroups.com.
> To post to this group, send email to sympy@googlegroups.com.
> Visit this group at https://groups.google.com/group/sympy.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/sympy/1f93f41c-ebf8-4402-990d-cc4f9ca22aa5%40googlegroups.com
> <https://groups.google.com/d/msgid/sympy/1f93f41c-ebf8-4402-990d-cc4f9ca22aa5%40googlegroups.com?utm_medium=email_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sympy+unsubscr...@googlegroups.com.
To post to this group, send email to sympy@googlegroups.com.
Visit this group at https://groups.google.com/group/sympy.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/CA%2B01voNq9mzBn5MAK-y6C5Ko4dcwfJ7diMN05tsHgAH5rm%3DYCg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [sympy] Idea for PR reviewing

2016-09-01 Thread Isuru Fernando
I think that's great idea, given the large number of open PRs.

Implementing this is very easy to do. What's hard is to find the correct
workflow.

How do you trigger the red X status? A comment in the PR with a specific
message?
How do you suggest turning the red X status off when the reviewer's
comments are addressed, but no new commits are sent?


Isuru Fernando

On Thu, Sep 1, 2016 at 10:47 PM, Aaron Meurer <asmeu...@gmail.com> wrote:

> One problem with PR reviewing is that it isn't always clear which PRs are
> ready to review, and which require more work.
>
> One solution that has been proposed in the past is these "PR: author's
> turn" and "PR: sympy's turn" labels. But the problem is that you can't
> change PR labels unless you have push access. So once a PR has a "PR:
> author's turn" label, the only way to remove it is if someone with push
> access removes it. And aside from that, people aren't diligent enough to
> always keep the labels updated.
>
> But I just noticed that as I go through the PRs list, I generally skip
> those PRs that have failing status label (a red X), as that means that some
> tests have failed, so there is already some work to do on the author's part
> to fix the PR (I also generally skip PRs with WIP, unless I am specifically
> interested in them).
>
> So my idea is to have some kind of "CI service" that lets any PR reviewer
> assign a status label to the PR, either a checkmark for "passes review" or
> an X for "needs work". The status itself could link to a comment that
> points out what needs to be done. That way, any PR that "needs work" will
> have a red X, and I can see when going through the list that I can skip it.
>
> The nice thing about this is that, because the status is only assigned to
> the most recent commit, as soon as the PR author pushes a new commit, the
> red X status for the "needs work" will go away.
>
> This could also bring accountability for our "all PRs must be reviewed"
> policy.
>
> Bitbucket actually has this feature built into their PR system, which is
> one thing I like about it, but I think it should be possible to do the same
> thing with GitHub with a bit of work.
>
> What do you think? Anyone have any idea how to implement something like
> this? Does anyone know if someone already has?
>
> Aaron Meurer
>
> --
> You received this message because you are subscribed to the Google Groups
> "sympy" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sympy+unsubscr...@googlegroups.com.
> To post to this group, send email to sympy@googlegroups.com.
> Visit this group at https://groups.google.com/group/sympy.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/sympy/CAKgW%3D6KVtuOF4CNBd2tUKr%2BOQSB0vSWbhkOLnAN19y7iZdW%
> 3DPw%40mail.gmail.com
> <https://groups.google.com/d/msgid/sympy/CAKgW%3D6KVtuOF4CNBd2tUKr%2BOQSB0vSWbhkOLnAN19y7iZdW%3DPw%40mail.gmail.com?utm_medium=email_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sympy+unsubscr...@googlegroups.com.
To post to this group, send email to sympy@googlegroups.com.
Visit this group at https://groups.google.com/group/sympy.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/CA%2B01voMmV5HYj-5KNFO2HwRGgaKjvq_b0ZN6QmcSkX3iaS7ZqQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [sympy] Re: Interested in contributing to Sympy, especially in the area of code generation

2016-06-22 Thread Isuru Fernando
Hi,

On Tue, Jun 21, 2016 at 3:28 PM, Björn Dahlgren <bjo...@gmail.com> wrote:

>
> On Monday, 20 June 2016 22:29:52 UTC+2, ruggero cyrille wrote:
>>
>> I'm interested in writing an LLVM IR backend similar to the C backend.
>>
>
> If you are well-versed in LLVM IR an interesting project would be to add
> JIT capabilities to SymEngine (the high-performance sister-project to
> SymPy),
> the LLVM docs have an example called "kaleidoscope" which is pretty close
> to what would need to be implemented, I can't speak for the SymEngine devs,
> but I think they would be interested.
> This would give us a very fast "lambdify" implementation.
>

We'd definitely be interested. I looked at the Kaleidoscope example and
HowToUseJIT and implemented it here,
https://github.com/isuruf/symengine/tree/llvm. If anybody is interested,
you can take a look at and see if it can be improved. Currently, it's
slower than the existing lambdify. I only have a day of experience with
LLVM, so I don't know what I'm doing wrong. If you can take a look, that'll
be great.

Isuru Fernando

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sympy+unsubscr...@googlegroups.com.
To post to this group, send email to sympy@googlegroups.com.
Visit this group at https://groups.google.com/group/sympy.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/CA%2B01voOSqu1QW5%2BtxaLe-rH3CJ%2B84CCkXMP8cofT_%3D1%3D%2Bj74XA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[sympy] Using SymEngine in SymPy

2016-04-27 Thread Isuru Fernando
Hi,

Now that SymEngine <https://github.com/symengine/symengine> has enough
methods ported from sympy.core, it can be used in other parts of sympy.

For example, I've been adding methods to symengine.py
<https://github.com/symengine/symengine.py> to mirror the SymPy API so that
`n_link_pendulum_on_cart` from PyDy can run without any conversions from
SymEngine to SymPy and vice versa. We chose sympy.physics and PyDy because
it uses less amount of things from other sympy modules.

For those who are unfamiliar let me explain how SymEngine and SymPy can
interoperate. In almost all functions in sympy, sympify is called on inputs
before doing anything. Symengine objects when sympified are converted
into sympy and therefore can be used in those functions. Similarly in
symengine, all methods call symengine's sympify which would convert sympy
objects to symengine. One additional thing that symengine do is that when
it goes through a sympy expression's tree and finds a function not defined
in symengine like Ynm, then it will create a PyFunction object to wrap the
Ynm object. Logic is there so that methods like subs, eval, hash, compare
can fallback to Python.

This is okay, but doesn't really help with sympy's speed as symengine
objects are converted to sympy as soon as a sympy function is called. To
avoid these conversions, I've started a PR here
<https://github.com/sympy/sympy/pull/11002>. What it does is it looks for
an environment variable USE_SYMENGINE and if found it uses symengine's
methods instead of sympy methods.

import os
if os.environ.get('USE_SYMENGINE'):
from symengine import sympify, diff, sin, cos, Matrix, symbols,
UndefFunction as Function
else:
from sympy import sympify, diff, sin, cos, Matrix, symbols, Function


Advantages over sympy is that symengine is faster. Symengine keeps objects
in data structures that are used to creating them. For example, an Add
keeps the dictionary of coefficients (output of
expr.as_coefficients_dict()). This structure is used throughout symengine
without flattening it to a list of Mul objects. So this leads to a better
time complexity than sympy.

Also since symengine is written in C++, true threading is also possible.
I've tried using OpenMP for embarrassingly parallel algorithms like taking
the jacobian of a matrix and differentiating all elements of a matrix and
it gives a good speedup for `n_link_pendulum_on_cart`.

One question I have is how do we test this? Is this something that should
be tested in symengine or sympy? Since symengine is written in C++ and the
default C++ compiler is different on different platforms, symengine is
tested on Linux (gcc, clang), OS X (gcc, AppleClang) and Windows (MSVC,
MinGW, MinGW-w64) with different compilers using Travis-CI and Appveyor.

Jason was okay to merge the PR as an undocumented feature, but what should
be done to support this officially?


Thanks,

Isuru Fernando

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sympy+unsubscr...@googlegroups.com.
To post to this group, send email to sympy@googlegroups.com.
Visit this group at https://groups.google.com/group/sympy.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/CA%2B01voP_-pOjKm40hbLzsryzWD%3DsnX_-A-GQYaFGL_%3DEO2ehVA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [symengine] Re: [sympy] Re: GSOC 2016: Classical Mechanics: Efficient Equation of Motion Generation with C++

2016-03-15 Thread Isuru Fernando
Hi,

You have to figure out which methods from sympy core and matrices are
called and check if SymEngine has implemented those. If not, then you can
start implementing them in SymEngine.

Isuru Fernando

On Fri, Mar 11, 2016 at 4:18 PM, Aravind Reddy <aravindreddy...@gmail.com>
wrote:

> Sir, I have been working on this project. Now I have found various
> functions that have been called from sympy that are not in sympy.physics
> module when n-link-pendulam code was run. These are majorly from sympy.core
> and sympy.matrices module. Now what should I do sir to get a clear picture
> of whole work? Please guide me sir.
>
> Thank you,
> Aravind
>
> --
> You received this message because you are subscribed to the Google Groups
> "symengine" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to symengine+unsubscr...@googlegroups.com.
> To post to this group, send email to symeng...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/symengine/5d1be54a-63eb-49d3-b02c-98cd72b46180%40googlegroups.com
> <https://groups.google.com/d/msgid/symengine/5d1be54a-63eb-49d3-b02c-98cd72b46180%40googlegroups.com?utm_medium=email_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sympy+unsubscr...@googlegroups.com.
To post to this group, send email to sympy@googlegroups.com.
Visit this group at https://groups.google.com/group/sympy.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/CA%2B01voP4-Qm97rZbvYL6By%2BqYN0Q1RTrVh9XATa0881j%2BgV9SA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [sympy] Re: How do you replace a function argument with a float?

2016-03-10 Thread Isuru Fernando
It is looking for mpmath's phi. See
https://github.com/sympy/sympy/blob/master/sympy/core/function.py#L458

Isuru Fernando

On Fri, Mar 11, 2016 at 12:33 AM, Aaron Meurer <asmeu...@gmail.com> wrote:

> Oh maybe it's just looking up the mpmath function named phi. We do have
>
> In [7]: import mpmath
>
> In [8]: mpmath.phi
> Out[8]: 
>
> Aaron Meurer
>
> On Thu, Mar 10, 2016 at 2:01 PM, Aaron Meurer <asmeu...@gmail.com> wrote:
> > Since this seems to break only when the function name is "phi", this
> > looks like an instance of https://github.com/sympy/sympy/issues/6938.
> > But I'm not quite sure what other SymPy function is named "phi". I
> > didn't find any in a quick grep.
> >
> > Aaron Meurer
> >
> > On Thu, Mar 10, 2016 at 1:54 PM, Sartaj Singh <singhsarta...@gmail.com>
> wrote:
> >> Apparently, this also does not work,
> >>
> >> # leosartaj at Mothership in ~/projects/sympy on git:master o [0:09:48]
> >> $ isympy
> >> IPython console for SymPy 1.0.1.dev (Python 2.7.11-64-bit) (ground
> types:
> >> python)
> >>
> >> These commands were executed:
> >>>>> from __future__ import division
> >>>>> from sympy import *
> >>>>> x, y, z, t = symbols('x y z t')
> >>>>> k, m, n = symbols('k m n', integer=True)
> >>>>> f, g, h = symbols('f g h', cls=Function)
> >>>>> init_printing()
> >>
> >> Documentation can be found at http://docs.sympy.org/dev
> >>
> >> In [1]: phi = symbols('phi', cls=Function)
> >>
> >> In [2]: phi(5.0)
> >>
> ---
> >> TypeError Traceback (most recent call
> last)
> >>  in ()
> >> > 1 phi(5.0)
> >>
> >> /home/leosartaj/projects/sympy/sympy/core/function.pyc in __new__(cls,
> >> *args, **options)
> >> 718 def __new__(cls, *args, **options):
> >> 719 args = list(map(sympify, args))
> >> --> 720 obj = super(AppliedUndef, cls).__new__(cls, *args,
> >> **options)
> >> 721 return obj
> >> 722
> >>
> >> /home/leosartaj/projects/sympy/sympy/core/cache.pyc in wrapper(*args,
> >> **kwargs)
> >>  93 retval = cfunc(*args, **kwargs)
> >>  94 except TypeError:
> >> ---> 95 retval = func(*args, **kwargs)
> >>  96 return retval
> >>  97
> >>
> >> /home/leosartaj/projects/sympy/sympy/core/function.pyc in __new__(cls,
> >> *args, **options)
> >> 390 pr2 = min(cls._should_evalf(a) for a in result.args)
> >> 391 if pr2 > 0:
> >> --> 392 return result.evalf(mlib.libmpf.prec_to_dps(pr))
> >> 393 return result
> >> 394
> >>
> >> /home/leosartaj/projects/sympy/sympy/core/evalf.pyc in evalf(self, n,
> subs,
> >> maxn, chop, strict, quad, verbose)
> >>1384 options['quad'] = quad
> >>1385 try:
> >> -> 1386 result = evalf(self, prec + 4, options)
> >>1387 except NotImplementedError:
> >>1388 # Fall back to the ordinary evalf
> >>
> >> /home/leosartaj/projects/sympy/sympy/core/evalf.pyc in evalf(x, prec,
> >> options)
> >>1282 if 'subs' in options:
> >>1283 x = x.subs(evalf_subs(prec, options['subs']))
> >> -> 1284 xe = x._eval_evalf(prec)
> >>1285 re, im = xe.as_real_imag()
> >>1286 if re.has(re_) or im.has(im_):
> >>
> >> /home/leosartaj/projects/sympy/sympy/core/function.pyc in
> _eval_evalf(self,
> >> prec)
> >> 501
> >> 502 with mpmath.workprec(prec):
> >> --> 503 v = func(*args)
> >> 504
> >> 505 return Expr._from_mpmath(v, prec)
> >>
> >>
> /home/leosartaj/anaconda/envs/my/lib/python2.7/site-packages/mpmath/ctx_mp_python.pyc
> >> in __call__(self, prec, dps, rounding)
> >> 344 if not rounding: rounding = rounding2
> >> 345 if dps: prec = dps_to_prec(dps)
> >> --> 346 return self.context.make_mpf(self.func(prec, rounding))
> >> 347
> >> 348 @property
> >&g

Re: [sympy] Re: Who can mentor for GSoC?

2016-02-09 Thread Isuru Fernando
Hi,

I'm willing to mentor a SymEngine project.

Isuru Fernando

On Tue, Feb 9, 2016 at 5:28 PM, AMiT Kumar <dtu.a...@gmail.com> wrote:

> Hi!
> I am willing to participate as a mentor.
>
>
> Regards,
> AMiT Kumar
>
> On Tuesday, February 9, 2016 at 2:29:41 AM UTC+5:30, Aaron Meurer wrote:
>>
>> GSoC organization applications are now open. We can apply as an org, but
>> before we do, I want to know how many people we have who can mentor. If you
>> are able to mentor (even if just for certain specific projects), please add
>> your name at
>> https://github.com/sympy/sympy/wiki/GSoC-2016-Ideas#potential-mentors.
>>
>> Ondrej, what do you plan with GSoC for SymEngine?
>>
>> Students, if you are interested in doing GSoC with SymPy, please read
>> https://github.com/sympy/sympy/wiki/GSoC-2016-Ideas and introduce
>> yourself in another thread on this list.
>>
>> Aaron Meurer
>>
> --
> You received this message because you are subscribed to the Google Groups
> "sympy" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sympy+unsubscr...@googlegroups.com.
> To post to this group, send email to sympy@googlegroups.com.
> Visit this group at https://groups.google.com/group/sympy.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/sympy/4eefbe9d-d678-4b18-b4b5-ade0334f0788%40googlegroups.com
> <https://groups.google.com/d/msgid/sympy/4eefbe9d-d678-4b18-b4b5-ade0334f0788%40googlegroups.com?utm_medium=email_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sympy+unsubscr...@googlegroups.com.
To post to this group, send email to sympy@googlegroups.com.
Visit this group at https://groups.google.com/group/sympy.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/CA%2B01voPE9%2BMNskwGwbczdu9TOUoGtQR25xO2D8gnRRrt661JFg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [sympy] test_args in PR

2015-11-29 Thread Isuru Fernando
Hi,

Test logs show that sympy.tensor.array module is not getting installed.
https://travis-ci.org/sympy/sympy/jobs/93753616#L713

You have to add it to the modules list in setup.py for the files to get
installed.

Isuru Fernando


On Sun, Nov 29, 2015 at 6:54 PM, Francesco Bonazzi <franz.bona...@gmail.com>
wrote:

> In the PR:
>
> https://github.com/sympy/sympy/pull/10180/
>
> There is a test failure in *test_args* that I cannot reproduce on my
> computer.
>
> Output is:
>
>
> 
>
> sympy/core/tests/test_args.py:test_sympy__tensor__array__dense_ndim_array__ImmutableDenseNDimArray
>
>
> File
> "/home/travis/virtualenv/pypy-2.5.0/site-packages/sympy-0.7.7.dev0-py2.7.egg/sympy/core/tests/test_args.py",
> line 3191, in
> test_sympy__tensor__array__dense_ndim_array__ImmutableDenseNDimArray
>
> from sympy.tensor.array.dense_ndim_array import ImmutableDenseNDimArray
>
> ImportError: No module named sympy.tensor.array
>
>
> 
>
> sympy/core/tests/test_args.py:test_sympy__tensor__array__sparse_ndim_array__ImmutableSparseNDimArray
>
>
> File
> "/home/travis/virtualenv/pypy-2.5.0/site-packages/sympy-0.7.7.dev0-py2.7.egg/sympy/core/tests/test_args.py",
> line 3197, in
> test_sympy__tensor__array__sparse_ndim_array__ImmutableSparseNDimArray
>
> from sympy.tensor.array.sparse_ndim_array import ImmutableSparseNDimArray
>
> ImportError: No module named sympy.tensor.array
>
>
> This is the case for PyPy, but it's the same with all supported versions
> of CPython.
>
> On my computer, these tests pass.
>
> Is there a bug or am I missing something?
>
> The code of the tests I added is here:
>
> https://github.com/Upabjojr/sympy/commit/bb88b9178e779efeb1cca61042124109940a25db#diff-ab4b280569cc3f8c86869046caf1e733R3187
>
> --
> You received this message because you are subscribed to the Google Groups
> "sympy" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sympy+unsubscr...@googlegroups.com.
> To post to this group, send email to sympy@googlegroups.com.
> Visit this group at http://groups.google.com/group/sympy.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/sympy/8dc77738-0ff8-4dc4-916d-0f5654bd771b%40googlegroups.com
> <https://groups.google.com/d/msgid/sympy/8dc77738-0ff8-4dc4-916d-0f5654bd771b%40googlegroups.com?utm_medium=email_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sympy+unsubscr...@googlegroups.com.
To post to this group, send email to sympy@googlegroups.com.
Visit this group at http://groups.google.com/group/sympy.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/CA%2B01voObNgs43AT0sCSxMe-Z%2BDdCZ5Behce_%2B0YgJstVQi79qw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [sympy] Chain rule and Subs

2015-05-01 Thread Isuru Fernando
Hi,

I'm not sure how to do the substitution, but why do you expect
 obj_function.diff(x) to be
Derivative(Theta(U(x), x), x) + Derivative(U(x), x)* Derivative(Theta(U(x),
x), U(x)) ?

I think the answer you are getting from sympy is not correct.
obj_function.diff(x) should be the same as Derivative(Theta(U(x), x), x),
but that is not what sympy is giving.
See, https://github.com/sympy/sympy/issues/8510

CSymPy is giving,
Derivative(U(x), x)*Subs(Derivative(Theta(_x, x), _x), (_x), (U(x))) +
Subs(Derivative(Theta(U(x), _x), _x), (_x), (x))
which I think should be the correct answer.

Here what  Subs(Derivative(Theta(U(x), _x), _x), (_x), (x)) means is
partial differentiate Theta with respect to the second variable and replace
the first variable with U(x) and the second with x.
(D[2](Theta)(U(x), x) is the equivalent in Maple syntax or Derivative[0,
1][Theta][U[x], x] in Mathematica syntax)

Isuru Fernando


On Fri, May 1, 2015 at 8:16 PM, Miguel Angel Salazar de Troya 
salazardetr...@gmail.com wrote:

 Hello

 I have this derivative of a function that has an argument which is also a
 function

 # Declaration
 x = symbols('x')
 U, Theta = symbols('U Theta', cls=Function)

 # Function to derive
 obj_function = Theta(U(x),x)

 # Derivative
 gradient_obj_function = obj_function.diff(x)

 And this is the output I obtain

 Derivative(Theta(U(x), x), x) + Derivative(U(x),
 x)*Subs(Derivative(Theta(_xi_1, x), _xi_1), (_xi_1,), (U(x),))

 How can I replace Subs(Derivative(Theta(_xi_1, x), _xi_1), (_xi_1,),
 (U(x),)) with Derivative(Theta(U(x), x), U(x)) ?
 I found this post, 
 https://groups.google.com/forum/#!searchin/sympy/chain$20rule/sympy/OfF5PklJtmY/t1FPWt3n8xIJ,
 but it was not clear to me how this has to be done.

 Thanks
 Miguel

 --
 You received this message because you are subscribed to the Google Groups
 sympy group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to sympy+unsubscr...@googlegroups.com.
 To post to this group, send email to sympy@googlegroups.com.
 Visit this group at http://groups.google.com/group/sympy.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/sympy/5d9dfd23-be1a-4a08-9289-43562d0062f5%40googlegroups.com
 https://groups.google.com/d/msgid/sympy/5d9dfd23-be1a-4a08-9289-43562d0062f5%40googlegroups.com?utm_medium=emailutm_source=footer
 .
 For more options, visit https://groups.google.com/d/optout.


-- 
You received this message because you are subscribed to the Google Groups 
sympy group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sympy+unsubscr...@googlegroups.com.
To post to this group, send email to sympy@googlegroups.com.
Visit this group at http://groups.google.com/group/sympy.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/CA%2B01voNocna%3D5Frerhb5Fy8nU59zdSPXnaO6A5SEXwp2cRZTeg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[sympy] GSoC - Make Sage use CSymPy as the symbolic engine

2015-03-10 Thread Isuru Fernando
Hi,

I'm Isuru Fernando. I'm a 3rd year Computer Science and Engineering
undergraduate at University of Moratuwa.

I've been working on CSymPy for some time now and would like to work on the
Sage GSoC project to use CSymPy as the symbolic engine.

I have a couple of questions regarding the project.

1. I know CSymPy has a requirement to send in a patch and get it merged
before sending in a proposal. Is there any requirement for Sage as well?

2. Who should I contact from Sage for questions regarding Pynac and the
symbolic module to get to know the requirements and scope of the project?

Thanks,

Isuru Fernando

-- 
You received this message because you are subscribed to the Google Groups 
sympy group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sympy+unsubscr...@googlegroups.com.
To post to this group, send email to sympy@googlegroups.com.
Visit this group at http://groups.google.com/group/sympy.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/CA%2B01voO5RE-1M6fR9dagxj12nK8g4yUHoEc%2B7bar7wPk7xa_ZQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.