Skip to content

Commit

Permalink
a pull
Browse files Browse the repository at this point in the history
  • Loading branch information
Kully committed May 30, 2017
1 parent 867a5ea commit de91e8c
Show file tree
Hide file tree
Showing 16 changed files with 7,648 additions and 3,513 deletions.
36 changes: 30 additions & 6 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,44 @@ This project adheres to [Semantic Versioning](http://semver.org/).

## [Unreleased]

## [2.0.8] - 2017-04-21
### Added
- Beta: Added API methods that wrap the API endpoint for managing Dash objects on plot.ly. The API interface is under `plotly.api.v2.dash_apps`
- offline embedded plots are now responsive to window resizing when `output_type == "div"` is set in `plotly.offline.iplot()`.
- Offline embedded plots are now responsive to window resizing when `output_type == "div"` is set in `plotly.offline.iplot()`.
- Offline animations are now supported on Plotly Cloud.

### Updated
- Updated `plotly.min.js` to version 1.26.0 for `plotly.offline`.
- See [the plotly.js CHANGELOG](https://github.com/plotly/plotly.js/blob/master/CHANGELOG.md) for additional information regarding the updates.

### Updated
- `plotly.offline.plot` and `plotly.offline.iplot` now accept various [configuration options](https://plot.ly/javascript/configuration-options/) for their arguments.

## [2.0.7] - 2017-04-07
### Updated
- Updated `plotly.min.js` to version 1.25.0 for `plotly.offline`.
- See [the plotly.js CHANGELOG](https://github.com/plotly/plotly.js/blob/master/CHANGELOG.md) for additional information regarding the updates.

### Added
- Added check to verify the share key is enabled when secret charts are created.

## [2.0.6] - 2017-03-20
### Added
- Added a new mimetype 'text/vnd.plotly.v1+html' for `iplot` outputs.

## [2.0.5] - 2017-03-07
## Fixed
### Fixed
- `import plotly` was broken in `2.0.3` and `2.0.2` because the new `dashboard_objs` wasn't included in our `setup.py`'s "`packages`". Now it is and `import plotly` and the other features introduced in `2.0.3` and `2.0.2` should work.

## [2.0.4] - 2017-03-07 [YANKED]
Note: This release's installation was broken. It has been removed from PyPI
## Added
### Added
- Added `dashboard_objs` to top level import.

## [2.0.3] - 2017-03-06 [YANKED]
Note: This release's installation was broken. It has been removed from PyPI
## Added
### Added
- Dashboards can now be created using the API and uploaded to Plotly. Use `import plotly.dashboard_objs` to create a `Dashboard` object. You can learn more about `Dashboard` objects by running `help(plotly.dashboard_objs)` and `help(plotly.plotly.plotly.dashboard_ops)` for uploading and retrieving dashboards from the cloud.


Expand All @@ -30,8 +56,6 @@ Note: This release's installation was broken. It has been removed from PyPI
See [https://github.com/nteract/nteract/pull/662](https://github.com/nteract/nteract/pull/662)
for the associated PR in nteract.
- As part of the above, plotly output now prints with a [custom mimetype](https://github.com/plotly/plotly.py/blob/f65724f06b894a5db94245ee4889c632b887d8ce/plotly/offline/offline.py#L348) - `application/vnd.plotly.v1+json`

### Added
- `memoize` decorator added to `plotly.utils`

### Changed
Expand Down Expand Up @@ -73,7 +97,7 @@ gone.
## [1.12.12] - 2016-12-06
### Updated
- Updated `plotly.min.js` to version 1.20.5 for `plotly.offline`.
- See [the plotly.js CHANGELOG](https://github.com/plotly/plotly.js/blob/master/CHANGELOG.md) for additional information regarding the updates
- See [the plotly.js CHANGELOG](https://github.com/plotly/plotly.js/blob/master/CHANGELOG.md) for additional information regarding the updates.
- `FF.create_scatterplotmatrix` now by default does not show the trace labels for the box plots, only if `diag=box` is selected for the diagonal subplot type.

## [1.12.11] - 2016-12-01
Expand Down
74 changes: 74 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# Contributor Covenant Code of Conduct

## Our Pledge

In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to making participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, gender identity and expression, level of experience,
nationality, personal appearance, race, religion, or sexual identity and
orientation.

## Our Standards

Examples of behavior that contributes to creating a positive environment
include:

* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

* The use of sexualized language or imagery and unwelcome sexual attention or
advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic
address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting

## Our Responsibilities

Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.

Project maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.

## Scope

This Code of Conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community. Examples of
representing a project or community include using an official project e-mail
address, posting via an official social media account, or acting as an appointed
representative at an online or offline event. Representation of a project may be
further defined and clarified by project maintainers.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at accounts@plot.ly. All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Further details of specific enforcement policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
members of the project's leadership.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
available at [http://contributor-covenant.org/version/1/4][version]

[homepage]: http://contributor-covenant.org
[version]: http://contributor-covenant.org/version/1/4/
2 changes: 1 addition & 1 deletion LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2016 Plotly, Inc
Copyright (c) 2016-2017 Plotly, Inc

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
21 changes: 16 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,27 @@
## plotly.py
##### an interactive, browser-based charting library for python
# plotly.py

> An interactive, browser-based graphing library for Python :sparkles:
Plotly for Python is now entirely open source, free, and self-hosted.

[![](https://plot.ly/~chriddyp/1825/.png)](https://plot.ly/~chriddyp/1825.embed)

[![](https://plot.ly/~chriddyp/1780/.png)](https://plot.ly/~chriddyp/1780.embed)

### [Documentation](https://plot.ly/python)
## [Documentation](https://plot.ly/python)

Take a look at [the website docs](https://plot.ly/python).

Or, check out the [README.rst](README.rst) for more.

### Contributing
## Contribute

Heck yeah! We've got suggestions! We've got guides!

Checkout [`contributing.md`](https://github.com/plotly/python-api/blob/master/contributing.md).
Check out [`contributing.md`](https://github.com/plotly/python-api/blob/master/contributing.md).

Also, all interactions with Plotly are governed by the [Code of Conduct](CODE_OF_CONDUCT.md). Just saying.

## License

[MIT](LICENSE.txt) © 2016-2017 Plotly, Inc.
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ plotly figures, with a one-liner::

py.plot_mpl(fig)

Checkout the `Plotly and mpld3`_ IPython notebook for more infomataion.
Checkout the `Plotly and mpld3`_ IPython notebook for more information.

Introduction to working with out API
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand Down
53 changes: 31 additions & 22 deletions contributing.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,18 @@
# Contributing

The bottom line. Follow your Nose, or our Nose. Write-run-love tests :fist:.

##Setup
## Code of Conduct

Check out the [Code of Conduct](CODE_OF_CONDUCT.md). Don't tl:dr; it, but the general idea is to be nice.

## Got Questions?

Open an issue! Go to https://github.com/plotly/plotly.py/issues. It's possible that your issue was already addressed. If it wasn't, open it. We also accept PRs; take a look at the steps below for instructions on how to do this.

## Setup

###Fork, Clone, Setup Your Version of the Plotly Python API
### Fork, Clone, Setup Your Version of the Plotly Python API

First, you'll need to *get* our project. This is the appropriate *clone* command (if you're unfamiliar with this process, https://help.github.com/articles/fork-a-repo):

Expand All @@ -12,7 +22,7 @@ First, you'll need to *get* our project. This is the appropriate *clone* command
git clone https://github.com/plotly/python-api.git
```

###Submodules
### Submodules

Second, this project uses git submodules! They're both helpful and, at times, difficult to work with. The good news is you probably don't need to think about them! Just run the following shell command to make sure that your local repo is wired properly:

Expand All @@ -35,7 +45,7 @@ Additionally, there are some project shortcuts that live in the `makefile` file.
make readme
```

###Making a Development Branch
### Making a Development Branch

Third, *don't* work in the `master` branch. As soon as you get your master branch ready, run:

Expand All @@ -46,22 +56,22 @@ git checkout -b my-dev-branch

... where you should give your branch a more descriptive name than `my-dev-branch`

###Pull Request When Ready
### Pull Request When Ready

Once you've made your changes (and hopefully written some tests...), make that pull request!

##Suggestions
## Suggestions

###Local Python
Setting up Python versions that *don't* require you to use `sudo` is a good idea. In addition, the core Python on your machine may not be the Python that we've developed in! Here are some nice guides for Mac, Windows, and Linux:
### Local Python
Setting up Python versions that *don't* require you to use `sudo` is a good idea. In addition, the core Python on your machine may not be the Python that we've developed in! Here are some nice guides for Mac, Windows, and Linux:
- http://docs.python-guide.org/en/latest/starting/install/osx/
- http://docs.python-guide.org/en/latest/starting/install/win/
- http://docs.python-guide.org/en/latest/starting/install/linux/

###Virtualenv
### Virtualenv
Virtualenv is a way to create Python environments on your machine that know nothing about one another. This is really helpful for ironing out dependency-problems arising from different versions of packages. Here's a nice guide on how to do this: http://docs.python-guide.org/en/latest/dev/virtualenvs/

###Alter Your PYTHONPATH
### Alter Your PYTHONPATH
The PYTHONPATH variable in your shell tells Python where to look for modules. Since you'll be developing, it'll be a pain to need to *install* Python every time you need to test some functionality (or at least ensure you're running code from the right directory...). You can easily make this change from a shell:

```bash
Expand All @@ -70,7 +80,7 @@ export PYTHONPATH="/path/to/local/repo:$PYTHONPATH"

Note, that's non-permanent. When you close the shell, that variable definition disappears. Also, `path/to/local/repo` is *your* specific repository path (e.g., `/Users/andrew/projects/python-api`).

###Why?
### Why?

Now you can run the following code and be guaranteed to have a working development version that you can make changes to on-the-fly, test, and be confident will not break on other's machines!

Expand All @@ -80,11 +90,11 @@ pip install -r optional-requirements.txt
export PYTHONPATH="/path/to/local/repo:$PYTHONPATH"
```

##Dependencies
## Dependencies

There's a short list of core dependencies you'll need installed in your Python environment to have any sort of fun with Plotly's Python API (see `requirements.txt`). Additionally, you're likely to have even more fun if you install some other requirements (see `optional-requirements.txt`).
There's a short list of core dependencies you'll need installed in your Python environment to have any sort of fun with Plotly's Python API (see `requirements.txt`). Additionally, you're likely to have even more fun if you install some other requirements (see `optional-requirements.txt`).

###Dependencies and Virtualenv
### Dependencies and Virtualenv

If you decided to follow the suggestion about about the Virtualenv *and* you've run `source bin/activate` within your new virtualenv directory to activate it--you can run the following to install the core dependencies:

Expand All @@ -98,14 +108,14 @@ To install the optional dependencies:
pip install -r optional-requirements.txt
```

##Testing
## Testing

We take advantage of two tools to run tests:

* [`tox`](https://tox.readthedocs.io/en/latest/), which is both a virtualenv management and test tool.
* [`nose`](https://nose.readthedocs.org/en/latest/), which is is an extension of Python's unittest

###Running Tests with `nose`
### Running Tests with `nose`

Since our tests cover *all* the functionality, to prevent tons of errors from showing up and having to parse through a messy output, you'll need to install `optional-requirements.txt` as explained above.

Expand Down Expand Up @@ -133,7 +143,7 @@ nosetests -w plotly/tests/test_plotly
nosetests plotly/tests/test_plotly/test_plot.py
```

###Running tests with `tox`
### Running tests with `tox`

Running tests with tox is much more powerful, but requires a bit more setup.

Expand Down Expand Up @@ -174,29 +184,28 @@ Note that anything after `--` is substituted in for `{posargs}` in the tox.ini.
tox -- -a '!slow','!matplotlib'
```

###Writing Tests
### Writing Tests

You're *strongly* encouraged to write tests that check your added functionality.
You're *strongly* encouraged to write tests that check your added functionality.

When you write a new test anywhere under the `tests` directory, if your PR gets accepted, that test will run in a virtual machine to ensure that future changes don't break your contributions!

#### Publishing to Pip

You'll need the credentials file `~/.pypirc`. Request access from @theengineear and @chriddyp. Then, from inside the repository:

```
```bash
(plotly.py) $ git checkout master
(plotly.py) $ git stash
(plotly.py) $ git pull origin master
(plotly.py) $ python setup.py sdist upload # upload to pip
```

After it has uploaded, move to another directly and double+triple check that you are able to upgrade ok:
```
```bash
$ pip install plotly --upgrade
```

And ask one of your friends to do it too. Our tests should catch any issues, but you never know.


<3 Team Plotly
5 changes: 3 additions & 2 deletions plotly/api/v2/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from __future__ import absolute_import

from plotly.api.v2 import (dashboards, files, folders, grids, images, plot_schema,
plots, spectacle_presentations, users)
from plotly.api.v2 import (dash_apps, dashboards, files, folders, grids,
images, plot_schema, plots, spectacle_presentations,
users)
26 changes: 26 additions & 0 deletions plotly/api/v2/dash_apps.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
"""
Beta interface to Plotly's /v2/dash-apps endpoints.
"""
from __future__ import absolute_import

from plotly.api.v2.utils import build_url, request

RESOURCE = 'dash-apps'


def create(body):
"""Create a dash app item."""
url = build_url(RESOURCE)
return request('post', url, json=body)


def retrieve(fid):
"""Retrieve a dash app from Plotly."""
url = build_url(RESOURCE, id=fid)
return request('get', url)


def update(fid, content):
"""Completely update the writable."""
url = build_url(RESOURCE, id=fid)
return request('put', url, json=content)
Loading

0 comments on commit de91e8c

Please sign in to comment.