-
-
Notifications
You must be signed in to change notification settings - Fork 574
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
Grab bag of issues #4331
Grab bag of issues #4331
Changes from all commits
230086b
562b4d2
c6d9a9c
136421f
992f59c
b8d1af6
7643dae
2abb7c5
1d631af
f6aa89c
30b5f79
8718e87
adb14c7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -84,6 +84,16 @@ The main one is the SunPy repository with where all the known `issues`_ with Sun | |
Each issue should have a series of labels that provide information about the nature of the issue. | ||
If you find an issue you'd like to work on, please make sure to add a comment to let people know that you are working on it! This will make it less likely that effort is duplicated. | ||
|
||
.. note:: | ||
|
||
sunpy is open source, under the BSD-2 license, and by contributing you are stating that you have the right to and agree to, have your work distributed under the terms of this license. | ||
|
||
If you work at a university or research institution, you will need to check if you can contribute code you have written at work. | ||
You should start by checking if there is a Open Source Software Policy (e.g., `Standford's policy <https://otl.stanford.edu/open-source-stanford>`__) for your work place. | ||
If not, `OSS-Watch <http://oss-watch.ac.uk/resources/contributing>`__ summaries what you will need to check and who to ask, however this is from a UK point of view. | ||
`Standford's guidance <https://otl.stanford.edu/sites/g/files/sbiybj10286/f/otlcopyrightguide.pdf>`__ for example allows someone to contribute and open source their code. | ||
If you are unsure if your university or institution allows you to contribute under the BSD-2 license, you should contact the relevant department or administrator that deals with copyright. | ||
Comment on lines
+89
to
+95
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This needs more passes and reviews. I was unsure what to suggest. I was able to find some resources but not many. |
||
|
||
If you are unsure where to start we suggest the `Good First Issue label`_. | ||
These are issues that have been deemed a good way to be eased into SunPy and are achievable with little understanding of the SunPy codebase. | ||
Please be aware that this does not mean the issue is "easy", just that you do not need to be aware of the underlying structure of SunPy. | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,25 +10,79 @@ Overview | |
All code must be documented and we follow these style conventions described here: | ||
|
||
* `numpydoc <https://numpydoc.readthedocs.io/en/latest/format.html#docstring-standard>`_ | ||
* `astropy <https://docs.astropy.org/en/latest/development/docrules.html>`_ | ||
|
||
We recommend familiarizing yourself with these references. | ||
We recommend familiarizing yourself with this style. | ||
|
||
Differences | ||
----------- | ||
Referring to other code | ||
----------------------- | ||
|
||
The current differences we have are as follows: | ||
To link to other methods, classes, or modules in sunpy you have to use backticks, for example: | ||
|
||
We backtick each type in the documentation strings so that they are interlinked by our documentation builder: | ||
.. code-block:: rst | ||
|
||
.. code-block:: python | ||
`sunpy.io.file_tools.read_file` | ||
|
||
""" | ||
Parameters | ||
---------- | ||
x : `type` | ||
Description of parameter x. | ||
""" | ||
generates a link like this: `sunpy.io.file_tools.read_file`. | ||
|
||
We use the sphinx setting ``default_role = 'obj'`` so that you don't have to use qualifiers like ``:class:``, ``:func:``, ``:meth:`` and the like. | ||
|
||
Often, you don't want to show the full package and module name. | ||
As long as the target is unambiguous you can simply leave them out: | ||
|
||
.. code-block:: rst | ||
|
||
`.read_file` | ||
|
||
and the link still works: `.read_file`. | ||
|
||
If there are multiple code elements with the same name (e.g. ``peek()`` is a method in multiple classes), you'll have to extend the definition: | ||
|
||
.. code-block:: rst | ||
|
||
`GenericMap.peek` or `CompositeMap.peek` | ||
|
||
These will show up as `GenericMap.peek` or `CompositeMap.peek`. | ||
To still show only the last segment you can add a tilde as prefix: | ||
|
||
.. code-block:: rst | ||
|
||
`~.GenericMap.peek` or `~.CompositeMap.peek` | ||
|
||
will render as `~.GenericMap.peek` or `~.CompositeMap.peek`. | ||
|
||
Other packages can also be linked via | ||
`intersphinx <http://www.sphinx-doc.org/en/master/ext/intersphinx.html>`_: | ||
|
||
.. code-block:: rst | ||
|
||
`numpy.max` | ||
|
||
will return this link: `numpy.max`. | ||
This works for Python, Numpy and Astropy (full list is in :file:`docs/conf.py`). | ||
If external linking fails, you can check the full list of referenceable objects with the following | ||
commands:: | ||
|
||
$ python -m sphinx.ext.intersphinx 'https://docs.python.org/3/objects.inv' | ||
|
||
If you want to link to a method or function you can add: | ||
|
||
.. code-block:: rst | ||
|
||
:func:`numpy.mean` | ||
|
||
which will render a link and extra brackets :func:`numpy.mean`. | ||
If you decide to use ``:meth:`` instead this will also render extra brackets but will not link in this case. | ||
This is because "numpy.mean" is a function. | ||
|
||
If you link to a method of a class, it will work. | ||
|
||
.. code-block:: rst | ||
|
||
:meth:`numpy.ndarray.mean` | ||
|
||
:meth:`numpy.ndarray.mean` but ``:func:`` will not. | ||
|
||
Never add ``:class:`` this will break the linking. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Much thanks to the MPL docs for this section. |
||
|
||
SunPy-Specific Rules | ||
-------------------- | ||
|
@@ -44,6 +98,7 @@ SunPy-Specific Rules | |
|
||
Documenting Data Sources | ||
---------------------------- | ||
|
||
Subclasses of `~sunpy.map.GenericMap` or `~sunpy.timeseries.TimeSeries` must provide a detailed docstring providing an overview of the data source that the object represents. | ||
In order to maintain consistency and completeness, the following information must be provided by a data source docstring, if available, and preferably in the following order: | ||
|
||
|
@@ -67,7 +122,7 @@ In addition, a reference section must be provided with links to the following re | |
* information to interpret metadata keywords such as FITS header reference | ||
* the data archive | ||
|
||
An example docstring can be found in the :ref:`Writing a new Instrument Map Class guide<new_maps_ts_etc>`. | ||
An example docstring can be found in the :ref:`Writing a new Instrument Map Class guide <new_maps_ts_etc>`. | ||
|
||
Sphinx | ||
====== | ||
|
@@ -94,7 +149,7 @@ Sphinx builds documentation iteratively, only adding things that have changed. | |
|
||
If you want to build the documentation without building the gallery, i.e. to reduce build times while working on other sections of the documentation you can run:: | ||
|
||
$ tox -e build_docs -- -D plot_gallery=0 | ||
$ tox -e build_docs -- -D plot_gallery=False | ||
|
||
If you'd like to start from scratch (i.e., remove the tox cache) then run:: | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isort update.