Skip to content

Readme for Figure Factory Creation #833

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 6 commits into from
Closed

Readme for Figure Factory Creation #833

wants to merge 6 commits into from

Conversation

Kully
Copy link
Contributor

@Kully Kully commented Sep 15, 2017

@chriddyp @cldougl Can one of you proof read my README? Shall I change the name of the file to README? Leave in the same directory?

@cldougl
Copy link
Member

cldougl commented Sep 15, 2017

I'll take a look!

@Kully
Copy link
Contributor Author

Kully commented Sep 15, 2017

I'll take a look!

Thanks. Man, don't know why the tests keep failing

@cldougl
Copy link
Member

cldougl commented Sep 19, 2017

@Kully they're failing on master too - can you make a pr to remove the offline test that signs into stage. It's pretty unstable/fails pretty consistently

@cldougl
Copy link
Member

cldougl commented Sep 19, 2017

@Kully is this pr for the presentation file as well?

@Kully
Copy link
Contributor Author

Kully commented Sep 19, 2017

@Kully is this pr for the presentation file as well?

No, that was from before when I added it to one of my branches to move from one branch to another. We can delete that file.

@@ -0,0 +1,113 @@
# Add Your Figure Factory to the Plotly [Python Library](https://plot.ly/python/)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would say: Add a Figure Factory to...

2. Checkout a new branch and give it an appropriate name.

```
$ git checkout -b "my-new-ff"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"add-ff-type"

```

## Create A figure_factory file
1. Creating python file and updating `__init__.py`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should keep all the directions in the same tense so

Create A figure_factory file

  1. Create a python file and update __init__.py

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you could probably split this step into 2 steps:
creating a python file and updating init.py

## Create A figure_factory file
1. Creating python file and updating `__init__.py`

You are now ready to start writing your code. Begin by moving to the `plotly.figure_factory` directory in the `plotly.py` repo. Notice that there is an `__init__.py` file as well as a bunch of `_figure_factory_chart.py` files in this directory. Each type of unique plotly chart gets its own python file, and the name of each python file is found in the `__init__.py` file.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rm You are now ready to start writing your code.
The directions might be a little easier to follow if they're more straight forward (i.e. more step by step and less conversational)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Each type of unique plotly chart gets its own python file

That's not really true, not each type of unique plotly chart but rather each figure factory chart. I think this is important to distinguish so people don't think they can edit a non-figure factory chart type from this repo (and end up looking for the scatter python file for instance).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i'll clarify, thank you

...
```

If you want to make, for example, a chart called `foo`, then you must create a python file `_foo.py` and then add the following line to the end of `__init__.py`:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it makes more sense for step 1 to be
create _foo.py
step 2 is then add _foo.py to init.py

# return fig
```

You _must_ include what is known as a documentation string or doc string in your function, which is just a block string taht contains useful information about what the function does, the arguments of the function and their descriptions, and examples of this function in use. The doc string is displayed when the help method is run by a user: `help(create_foo)` or `create_foo?` in Jupyter.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You must include a documentation string in your function. A doc string is a block string that contains useful information about what the function does, the arguments of the function and their descriptions, and examples of this function in use. The doc string is displayed when the help method is run by a user: help(create_foo) or create_foo? in python.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

*** (help works globally in python- not just jupyter)


You _must_ include what is known as a documentation string or doc string in your function, which is just a block string taht contains useful information about what the function does, the arguments of the function and their descriptions, and examples of this function in use. The doc string is displayed when the help method is run by a user: `help(create_foo)` or `create_foo?` in Jupyter.

The parameters are listed in the doc string with the format `:param (param_type) param_name: description.` Afterwards, you must include Examples which demonstrate the different capabilities and features of the function. For more information on proper doc string syntax see [PEP-257 page](https://www.python.org/dev/peps/pep-0257/).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no need to cap Examples


The parameters are listed in the doc string with the format `:param (param_type) param_name: description.` Afterwards, you must include Examples which demonstrate the different capabilities and features of the function. For more information on proper doc string syntax see [PEP-257 page](https://www.python.org/dev/peps/pep-0257/).

After the doc string, you may write the main code of your function, which should result in returning the `fig`. Users will use your function in the following way:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After the doc string, you will add the main code of your function, which should result in returning the fig.


## Push to GitHub

When you are finally finished your first draft of your figure factory, it is time to push it to the cloud and to get feedback from the Plotly team and other voluntary GitHub users. After you have added and commited all of your changes on the local branch, push the changes to a new remote branch on Git:
Copy link
Member

@cldougl cldougl Sep 19, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not 100% sure what:

it is time to push it to the cloud

means.
Shouldn't we explain how to create a pr. They want to push their code to their remote github branch.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When you have finished the first draft of your figure factory, it is time to create a pull request for the Plotly team to review.

$ git push origin my-new-ff
```

Thank you for reading and thanks for contributing to Plotly's Graphing Library!
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

may want to link the general plotly.py contribution instructions as well

@@ -0,0 +1,143 @@
# Add A Figure Factory to the Plotly [Python Library](https://plot.ly/python/)

If you have ever wanted to contribute to the Plotly Python Library by adding a new chart type we don't have, now you can! This README will help you get started cloning the plotly.py repo, forking a new branch, creating a new figure factory, and creatng a new Pull Request to get feedback for merging. Just follow all these steps and you'll be ready to go.
Copy link
Member

@cldougl cldougl Sep 26, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changes look good! I'm wondering if it would be better to start out describing/clarifying the differences between figure factories (wrappers around plotly.js charts to create a new chart type) and plotly.graph_objs?

@Kully
Copy link
Contributor Author

Kully commented Oct 2, 2017

@cldougl okay, I added a blurb about figurefactories and py.graph_objs
Ready for another 👀

@Kully
Copy link
Contributor Author

Kully commented Oct 3, 2017

Relocated to #844 and closing for duplicate PR reasons.

@Kully Kully closed this Oct 3, 2017
@Kully Kully deleted the readme-for-ff branch October 3, 2017 15:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants