GithubHelp home page GithubHelp logo

planet-sympy's Introduction

SymPy

pypi version Join the chat at https://gitter.im/sympy/sympy Zenodo Badge Downloads GitHub Issues Git Tutorial Powered by NumFocus Commits since last release

SymPy Banner

See the AUTHORS file for the list of authors.

And many more people helped on the SymPy mailing list, reported bugs, helped organize SymPy's participation in the Google Summer of Code, the Google Highly Open Participation Contest, Google Code-In, wrote and blogged about SymPy...

License: New BSD License (see the LICENSE file for details) covers all files in the sympy repository unless stated otherwise.

Our mailing list is at https://groups.google.com/forum/?fromgroups#!forum/sympy.

We have a community chat at Gitter. Feel free to ask us anything there. We have a very welcoming and helpful community.

Download

The recommended installation method is through Anaconda, https://www.anaconda.com/products/distribution

You can also get the latest version of SymPy from https://pypi.python.org/pypi/sympy/

To get the git version do

$ git clone https://github.com/sympy/sympy.git

For other options (tarballs, debs, etc.), see https://docs.sympy.org/dev/install.html.

Documentation and Usage

For in-depth instructions on installation and building the documentation, see the SymPy Documentation Style Guide.

Everything is at:

https://docs.sympy.org/

You can generate everything at the above site in your local copy of SymPy by:

$ cd doc
$ make html

Then the docs will be in _build/html. If you don't want to read that, here is a short usage:

From this directory, start Python and:

>>> from sympy import Symbol, cos
>>> x = Symbol('x')
>>> e = 1/cos(x)
>>> print(e.series(x, 0, 10))
1 + x**2/2 + 5*x**4/24 + 61*x**6/720 + 277*x**8/8064 + O(x**10)

SymPy also comes with a console that is a simple wrapper around the classic python console (or IPython when available) that loads the SymPy namespace and executes some common commands for you.

To start it, issue:

$ bin/isympy

from this directory, if SymPy is not installed or simply:

$ isympy

if SymPy is installed.

Installation

To install SymPy using PyPI, run the following command:

$ pip install sympy

To install SymPy using Anaconda, run the following command:

$ conda install -c anaconda sympy

To install SymPy from GitHub source, first clone SymPy using git:

$ git clone https://github.com/sympy/sympy.git

Then, in the sympy repository that you cloned, simply run:

$ pip install .

See https://docs.sympy.org/dev/install.html for more information.

Contributing

We welcome contributions from anyone, even if you are new to open source. Please read our Introduction to Contributing page and the SymPy Documentation Style Guide. If you are new and looking for some way to contribute, a good place to start is to look at the issues tagged Easy to Fix.

Please note that all participants in this project are expected to follow our Code of Conduct. By participating in this project you agree to abide by its terms. See CODE_OF_CONDUCT.md.

Tests

To execute all tests, run:

$./setup.py test

in the current directory.

For the more fine-grained running of tests or doctests, use bin/test or respectively bin/doctest. The master branch is automatically tested by GitHub Actions.

To test pull requests, use sympy-bot.

Regenerate Experimental LaTeX Parser/Lexer

The parser and lexer were generated with the ANTLR4 toolchain in sympy/parsing/latex/_antlr and checked into the repo. Presently, most users should not need to regenerate these files, but if you plan to work on this feature, you will need the antlr4 command-line tool (and you must ensure that it is in your PATH). One way to get it is:

$ conda install -c conda-forge antlr=4.11.1

Alternatively, follow the instructions on the ANTLR website and download the antlr-4.11.1-complete.jar. Then export the CLASSPATH as instructed and instead of creating antlr4 as an alias, make it an executable file with the following contents:

#!/bin/bash
java -jar /usr/local/lib/antlr-4.11.1-complete.jar "$@"

After making changes to sympy/parsing/latex/LaTeX.g4, run:

$ ./setup.py antlr

Clean

To clean everything (thus getting the same tree as in the repository):

$ git clean -Xdf

which will clear everything ignored by .gitignore, and:

$ git clean -df

to clear all untracked files. You can revert the most recent changes in git with:

$ git reset --hard

WARNING: The above commands will all clear changes you may have made, and you will lose them forever. Be sure to check things with git status, git diff, git clean -Xn, and git clean -n before doing any of those.

Bugs

Our issue tracker is at https://github.com/sympy/sympy/issues. Please report any bugs that you find. Or, even better, fork the repository on GitHub and create a pull request. We welcome all changes, big or small, and we will help you make the pull request if you are new to git (just ask on our mailing list or Gitter Channel). If you further have any queries, you can find answers on Stack Overflow using the sympy tag.

Brief History

SymPy was started by Ondřej Čertík in 2005, he wrote some code during the summer, then he wrote some more code during summer 2006. In February 2007, Fabian Pedregosa joined the project and helped fix many things, contributed documentation, and made it alive again. 5 students (Mateusz Paprocki, Brian Jorgensen, Jason Gedge, Robert Schwarz, and Chris Wu) improved SymPy incredibly during summer 2007 as part of the Google Summer of Code. Pearu Peterson joined the development during the summer 2007 and he has made SymPy much more competitive by rewriting the core from scratch, which has made it from 10x to 100x faster. Jurjen N.E. Bos has contributed pretty-printing and other patches. Fredrik Johansson has written mpmath and contributed a lot of patches.

SymPy has participated in every Google Summer of Code since 2007. You can see https://github.com/sympy/sympy/wiki#google-summer-of-code for full details. Each year has improved SymPy by bounds. Most of SymPy's development has come from Google Summer of Code students.

In 2011, Ondřej Čertík stepped down as lead developer, with Aaron Meurer, who also started as a Google Summer of Code student, taking his place. Ondřej Čertík is still active in the community but is too busy with work and family to play a lead development role.

Since then, a lot more people have joined the development and some people have also left. You can see the full list in doc/src/aboutus.rst, or online at:

https://docs.sympy.org/dev/aboutus.html#sympy-development-team

The git history goes back to 2007 when development moved from svn to hg. To see the history before that point, look at https://github.com/sympy/sympy-old.

You can use git to see the biggest developers. The command:

$ git shortlog -ns

will show each developer, sorted by commits to the project. The command:

$ git shortlog -ns --since="1 year"

will show the top developers from the last year.

Citation

To cite SymPy in publications use

Meurer A, Smith CP, Paprocki M, Čertík O, Kirpichev SB, Rocklin M, Kumar A, Ivanov S, Moore JK, Singh S, Rathnayake T, Vig S, Granger BE, Muller RP, Bonazzi F, Gupta H, Vats S, Johansson F, Pedregosa F, Curry MJ, Terrel AR, Roučka Š, Saboo A, Fernando I, Kulal S, Cimrman R, Scopatz A. (2017) SymPy: symbolic computing in Python. PeerJ Computer Science 3:e103 https://doi.org/10.7717/peerj-cs.103

A BibTeX entry for LaTeX users is

@article{10.7717/peerj-cs.103,
 title = {SymPy: symbolic computing in Python},
 author = {Meurer, Aaron and Smith, Christopher P. and Paprocki, Mateusz and \v{C}ert\'{i}k, Ond\v{r}ej and Kirpichev, Sergey B. and Rocklin, Matthew and Kumar, Amit and Ivanov, Sergiu and Moore, Jason K. and Singh, Sartaj and Rathnayake, Thilina and Vig, Sean and Granger, Brian E. and Muller, Richard P. and Bonazzi, Francesco and Gupta, Harsh and Vats, Shivam and Johansson, Fredrik and Pedregosa, Fabian and Curry, Matthew J. and Terrel, Andy R. and Rou\v{c}ka, \v{S}t\v{e}p\'{a}n and Saboo, Ashutosh and Fernando, Isuru and Kulal, Sumith and Cimrman, Robert and Scopatz, Anthony},
 year = 2017,
 month = Jan,
 keywords = {Python, Computer algebra system, Symbolics},
 abstract = {
            SymPy is an open-source computer algebra system written in pure Python. It is built with a focus on extensibility and ease of use, through both interactive and programmatic applications. These characteristics have led SymPy to become a popular symbolic library for the scientific Python ecosystem. This paper presents the architecture of SymPy, a description of its features, and a discussion of select submodules. The supplementary material provides additional examples and further outlines details of the architecture and features of SymPy.
         },
 volume = 3,
 pages = {e103},
 journal = {PeerJ Computer Science},
 issn = {2376-5992},
 url = {https://doi.org/10.7717/peerj-cs.103},
 doi = {10.7717/peerj-cs.103}
}

SymPy is BSD licensed, so you are free to use it whatever you like, be it academic, commercial, creating forks or derivatives, as long as you copy the BSD statement if you redistribute it (see the LICENSE file for details). That said, although not required by the SymPy license, if it is convenient for you, please cite SymPy when using it in your work and also consider contributing all your changes back, so that we can incorporate it and all of us will benefit in the end.

planet-sympy's People

Contributors

abhinav-anand-addepar avatar arifahmed1995 avatar arighnaiitg avatar arihantparsoya avatar asmeurer avatar bjodah avatar certik avatar czgdp1807 avatar friyaz avatar gxyd avatar jashan498 avatar jmig5776 avatar kangzhiq avatar mijo2 avatar mohitbalwani26 avatar namannimmo10 avatar rajithv avatar ranjithkumar007 avatar ravicharann avatar sachin-4099 avatar sc0rpi0n101 avatar shekharrajak avatar shikharj avatar shubhamkjha avatar shubhamtibra avatar smit-create avatar sumith1896 avatar szymag avatar valglad avatar yathartha22 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

planet-sympy's Issues

Dockerfile todo list

  • Install all prerequisites and copy over the planet subdirectory in this repo and make sure it runs (see e.g. nbviewer's Dockerfile how to do that)
  • Install cron to run the update periodically (see e.g. here for instructions)
  • Add automatic push of the generated html pages into github from the cron job. This requires to have a github token, that will be passed to the docker image via an environment variable (as well as a git repository URL, also passed in as a variable). On Travis we pass in a token for a test repository that we just keep somewhere. In production (e.g. on Linode), we put in a token for the planet.sympy.org github repo.
  • add a deploy key to Travis and push to a test repository in PRs/master, i.e. Travis never pushes into the production repository, but it will test that everything works as expected (#22)
  • Setup automatic uploading of the final docker image to docker hub every time master changes (i.e. a PR gets merged). See here for instructions. (#23)

To test it on Travis, we just have to figure out how to trigger a cron job run, which will generate new html pages by aggregating the blogs for planet.sympy.org and pushes to the test repository. If any command fails, then Travis will fail. We'll probably simply examine the html pages in this test repository manually, because it's hard to write a good test for that, and if things get pushed, then it probably works.

People can then send PRs against this repository, e.g. when a new blog is added or removed, or some improvements of the design. Travis will then test the PR to make sure things work, if it passes, we merge the PR, which will trigger uploading the new docker image on docker hub. Then on our production server we simply switch to a new image. If, for some reason, the new image doesn't work in production, we simply revert to the old (working) image.

Page build failure

I've been getting quite a few of "[planet-sympy/planet.sympy.org] Page build failure" emails from GitHub. Here is how the email looks like:

The page build failed for the `gh-pages` branch with the following error:

unable to build page. Please try again later.

For information on troubleshooting Jekyll see:

  https://help.github.com/articles/troubleshooting-jekyll-builds

If you have any questions you can contact us by replying to this email.

It doesn't provide any other information. Here are the dates/times of the 11 most recent emails:

Tue, Apr 4, 2017 at 8:42 AM
Tue, May 2, 2017 at 6:32 PM
Tue, May 2, 2017 at 7:13 PM
Wed, May 10, 2017 at 8:22 AM
Wed, May 31, 2017 at 7:11 AM
Thu, Jun 1, 2017 at 4:32 PM
Thu, Jun 1, 2017 at 11:52 PM
Fri, Jun 2, 2017 at 6:33 AM
Fri, Jun 2, 2017 at 9:18 AM
Sun, Jun 4, 2017 at 8:52 PM
Mon, Jun 5, 2017 at 3:52 AM

I don't know what is going on or what can be causing this, but it seems that besides these failures things work.

GSoC students section

I have a new GSoC students in the navbar if you noticed. What this field should do is list the students(as listed in People aggregated) we select. So it should work as People aggregated but only for selected candidates. (This should be possible by an extra field in config file or so).

And here if the last post of the person is > 7 days, it should be displayed in red.
We have a rule of one blog post per week for GSoC students, this will capture that.

/cc @certik @asmeurer @ranveeraggarwal

Update planet.sympy.org

Right now the planet.sympy.org doesn't seem to be updated. The issue is that the docker image at Docker hub stopped being updated for some reason. So I am implementing a more robust solution in #91 that will use GitLab-CI to build the docker image, that way we can easily inspect it and trigger it if needed.

Automatic deployment of the docker image

First some prerequisites must be fixed:

  • Make Travis test the deployment of the html pages to a test repository (#22), to ensure that everything works
  • Build docker image automatically from master (#23)

After these are fixed, what remains is to pull the built image into docker and run it on the production server instead of the old container (the old master), which can be done with two simple commands, e.g.:

docker kill OLD_CONTAINER_ID
docker run -d -e DEPLOY_TOKEN=XXX sympy/planet-sympy:v15

The OLD_CONTAINER_ID is the ID of the currently running container, XXX is specified on the server, and sympy/planet-sympy:v15 is the docker image tag, that changes with every deployment (typically the v15 increments to v16 for the next commit to master, but this can be changed). The first command kills the old container, and the second command will download the image from docker hub automatically, if it is not already cached locally, and run it.

So this is already extremely simple, compared to what maintenance nightmare the old planet sympy setup was. I am doing this manually for now. Until #23 is fixed, I am actually also doing this manually before the above two commands:

docker build -t sympy/planet-sympy:v15 .

Again, very simple, but it'd be nice not to have to do that either. For the docker build command, I actually have to have the latest planet-sympy repo checked out and be in the repository. For the docker kill and docker run commands, I don't even have to have the planet-sympy repository checked out, so things become even simpler.

So some tooling needs to be built around this to automate this last part (docker kill and docker run). I am sure we are not the only ones facing this issue, so let's see how other people are automating this.

Pass in the DEPLOY_TOKEN as a runtime variable

Currently one must set the DEPLOY_TOKEN by hand in the crontab file and rebuild the image. A better way is to set the DEPLOY_TOKEN at runtime like this:

docker run -d -e DEPLOY_TOKEN=XXX test/planet-sympy:v1

But for some reason, the ./update.sh script only sees this variable when executed from the user directly, but does not see it when executed via cron.

README errors

Correct docker build. Now it is saying sympy-paper which is wrong. Error might have crept in while transferring.

Use doctr

Using doctr might simplify quite a few lines in our deploy script:

https://github.com/drdoctr/doctr

@asmeurer mentioned that perhaps drdoctr/doctr#189 must be fixed first, though perhaps not, since we actually run this inside Docker, and whether the docker container is run on Travis-CI or GitLab-CI makes no difference to the code within.

LICENSE this

rawdog that we depend on is GPL licensed. So what appropriate license should this have?
GPL or LGPL?
I'm not very aware of how this works

How to test the docker container locally?

It seems that when you "run" the docker container, it tries to deploy it. How do I just run it locally, without any deploying, to test something out?

Also, I don't think that "run" should deploy. There should be a deploy.sh script or something to deploy, and run should just run the server.

Older Blog entries buggy

As you see at the bottom, Older Blog Entries button is not working. The button came up but the next index.html page has no content.

We'll need an equivalent Newer Blog Entries too.

/cc @certik

PS: @ranveeraggarwal is well acquainted with this. He can help us out

GSoC Students button

The GSoC Students button at the top doesn't work. I'm not sure what it looks like when it does work, but something that makes it easy to see when each student most recently blogged would be the most helpful.

[GSoC] Blog link needs to be re-updated

I have been posting all my GSoC blogs here at this link. The url in the config.yml file of my github.io repository was wrongly updated previously. I have updated it correctly, but the link still seems to be broken.
What can be done in this case? Can I remove the link from planet-sympy, and re-host it again? Any suggestions? @asmeurer @certik

Larger Twitter popovers

Since the twitter and #sympy links popover, is it possible to make them fit all the way to the bottom of the page, so that they fit more tweets?

MathJax math does not render

Search planet.sympy.org for instance for gxyd. You can see the math in his posts isn't rendered (it just shows with $). If you go to the posts on his website, however, it renders fine.

Use Travis to test deployment

Currently we exit early if DEPLOY_TOKEN is empty, e.g. on Travis:

if [ "${DEPLOY_TOKEN}" = "" ]; then

So anything after that is not tested. As such, of course, I broke it in #17 when I modified the end of the script, even though Travis passed, and it had to be fixed by 07765a0. The solution is to add a Travis ssh key into the repository, using the travis subdirectory (see the README there for more info how it works), which will generate another set of private/public keys, and we put the public key into a new testing repository on github, which will receive deployments from PRs.

In addition, the Travis test which executes docker should then be written as close to real deployment as possible. This means the deployment repository URL should be passed as an environment variable. And probably we should pass another variable denoting how many times it should get deployed (2x should be tested --- to ensure that the upload.sh script can be executed 2x, this tests things like proper cleaning of generated files between runs), in production it's infinity, and finally, how much time between runs (something like 1s for testing, and 20 min for production).

That way everything will be tested to the very end, ensuring that it works.

Add person's name to the front of the feed title

You can see from the earlier tweets here that the RSS used to always put the person's name at the front of the post title. Now, you can see the latest tweet just says "Selected", instead of "Srajan Garg: Selected".

Can we bring the old way back? That would add a lot more context to the Twitter feed. I just checked and there doesn't seem to be a way to customize this in twitterfeed.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.