Skip to content

Commit 090cb22

Browse files
committed
Fix: alt tags and spelling
Final alt tags and cleanup
1 parent 6057b53 commit 090cb22

File tree

2 files changed

+29
-28
lines changed

2 files changed

+29
-28
lines changed
39.7 KB
Loading

tutorials/intro.md

Lines changed: 29 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ create a Python package.
77

88
:::{figure-md} packaging-outline
99

10-
<img src="../images/tutorials/packaging-101-outline.png" alt="Diagram showing the lessons in our packaging tutorial." width="800px">
10+
<img src="../images/tutorials/packaging-101-outline.png" alt="Diagram showing the lessons in our packaging tutorial. There are 6 total - what is a python package, make code pip installable, publish your package to PyPI, add a readme and license file, add metadata for pypi and finally publish to conda forge." width="800px">
1111

12-
Packaging tutorial overview graphic
12+
This lesson is the first in a series of lessons to help you get started with Python packaging.
1313
:::
1414

1515
## Who are these tutorials for?
@@ -43,7 +43,7 @@ After reading this lesson you will:
4343

4444
- Understand what a Python package is
4545
- Be able to list the 5 core components of a Python package
46-
- You will be able to explain the difference between generalizable code and code that supports a specific scientific application
46+
- Be able to explain the difference between generalizable code and code that supports a specific scientific application
4747

4848
:::
4949

@@ -60,7 +60,7 @@ Structurally, in Python, a package is a directory with a specific
6060
file structure. Within the package directory structure, there are
6161
modules which are files that end in `.py` (the same extension you'd
6262
see in a Python script). These modules allow you to group and
63-
structure yourPython code. Each module contains functions and classes,
63+
structure your Python code. Each module contains functions and classes,
6464
that you can think about as the tools in your toolbox.
6565

6666
:::{figure-md} python-toolbox
@@ -73,10 +73,11 @@ well.
7373
:::
7474

7575
### Python packages are installable
76+
7677
A package is installable, which means that you can add the
7778
functionality within the package's code to any Python environment and
7879
import that functionality like you would import core Python packages such
79-
as NumPy or matplotlib.
80+
as NumPy or Matplotlib.
8081

8182
```python
8283
import numpy
@@ -88,11 +89,11 @@ Structuring your code as a package is the first step you need to take so you can
8889

8990
## Why create a Python package?
9091

91-
There are numerous reasons why you might create a Python package:
92+
You might create a Python package because you want to:
9293

93-
- **Use your code across multiple projects:** At its most basic level, creating a package allows you to install your code into a Python environment. This allows you to then import functions and classes into any workflows both locally and in the cloud..
94-
- **Share your code:** Sharing your code with others is often a common reason to create a package. If you publish a package on a public repository such as PyPI or conda, immediately your package can be installed on any machine using pip or conda with a single command.
95-
- **Build community around your code:** Packages make it easier for multiple people to work on the same project (particularly when published on Github). A version platform such as git (the version control system used by GitHub), further makes it easier to track changes to the codebase over time. Tools such as issues and pull requests make it easier for outside users to contribute bug fixes and to establish review processes for accepting changes to the code base..
94+
- **Use your code across different projects:** At its most basic level, creating a package allows you to install your code into a Python environment. This allows you to then import functions and classes into any workflows both locally and in the cloud..
95+
- **Share your code:** If you publish a package on a public repository such as PyPI or conda, your package can be installed on any machine using pip or conda with a single command.
96+
- **Build community around your code:** Packages make it easier for multiple people to work on the same project (particularly when published on GitHub). A version platform such as git (the version control system used by GitHub), further makes it easier to track changes to the codebase over time. Tools such as issues and pull requests make it easier for outside users to contribute bug fixes and to establish review processes for accepting changes to the code base..
9697
- **Organize your code:** Packages can be used to organize large code projects, dividing them into smaller, more manageable components. This structure can help with both maintaining the codebase and with making it easier to understand.
9798

9899
### What to consider before you create a package
@@ -105,7 +106,7 @@ time and effort. Before you begin, think about your goals including:
105106
- Whether you have time to add things such as documentation and tests
106107
- How long you might be able to maintain it: remember that once people begin using your package they will depend on your maintainer team to update it, fix bugs and answer questions.
107108

108-
Before creating a package that is user-facing, it's important to consider all of the above!
109+
Before creating a user-facing package, it's important to consider all of the above.
109110

110111
## The elements of a Python package
111112

@@ -227,8 +228,8 @@ supports a specific research project. It aims to enhance the reproducibility and
227228
transparency of research by providing a comprehensive record of the methods,
228229
data, and analyses used in a study.
229230

230-
A Python package however is a collection of modules that are focused on a
231-
specific set of tasks that can be applied across numerous research projects.
231+
A Python package is a collection of modules that can be used to perform a
232+
specific set of tasks. These tasks should be applicable to numerous workflows.
232233
As such a Python package is more generalizable than a Research Compendium
233234
which supports a specific project.
234235

@@ -240,30 +241,30 @@ which supports a specific project.
240241
Below are a few examples well scoped pyOpenSci packages:
241242

242243
* [Crowsetta](https://crowsetta.readthedocs.io/en/latest/): is a package designed to work with annotating animal vocalizations and bioacoustics data. This package helps scientists process different types of bioacoustic data rather than focusing on a specific individual research application associated with a user-specific research workflow.
243-
* [pandera](https://www.union.ai/pandera) is another more broadly used Python package. Pandera supports data testing and thus also has a broader research application.
244+
* [Pandera](https://www.union.ai/pandera) is another more broadly used Python package. Pandera supports data testing and thus also has a broader research application.
244245

245246
:::{admonition} Matplotlib as an example
246247

247248
At the larger end of the user spectrum, Matplotlib is a great example.
248-
Matplotlib does one (big important) thing really well:
249+
Matplotlib does one thing really well:
249250

250251
*It creates visual plots of data.*
251252

252-
Matplotlib is used by thousands of users for different plotting applications
253+
Thousands of people use Matplotlib for different plotting applications
253254
using different types of data. While few scientific packages will have the same
254-
broad application and large user base as tools like Matplotlib, the
255+
broad application and large user base that Matplotlib has, the
255256
idea of scoping out what your package does is still important.
256257
:::
257258

258259
### Code should also be clean & readable & documented
259260

260-
The code in your package should also be clean, readable and well documented.
261+
The code in your package should also be clean, readable, and well documented.
261262

262263
**Clean code:** Clean code refers to code that uses expressive variable names,
263-
is concise and does not repeat itself. We will dive deeper into best practices
264+
is concise and doesn't repeat itself. You can learn about best practices
264265
for clean code in future pyOpenSci tutorials.
265266

266-
**Readable code:** Readable code is code written with a consistent style.
267+
**Readable code:** readable code is code written with a consistent style.
267268
You can use linters and code formatters such as black and flake8 to ensure
268269
this consistency throughout your entire package. [Learn more about code formatters here.](../package-structure-code/code-style-linting-format.html)
269270

@@ -275,15 +276,15 @@ what the input and output elements of each function is. [You can learn more abou
275276

276277
### Python packages and environments
277278

278-
A Python package can be installed into a Python environment in the same way
279+
You can install a Python package into a Python environment in the same way
279280
you might install NumPy or pandas. Installing your package into an environment
280281
allows you to access it from any code run with that specific Python environment activated.
281282

282283
:::{figure-md} packages-environment
283284

284285
<img src="../images/tutorials/environment-package-install.png" alt="Diagram showing the steps associated with creating a package and then installing it. The first arrow says your package and the second says pip install package. The second arrow leads to a box that represents a python environment that already has some packages installed such as pandas and NumPy. Your package will also get installed into that same environment when you pip install it." width="700px">
285286

286-
You don't have to publish to PyPI in order to make your code installable.
287+
You don't have to publish to PyPI to make your code installable.
287288
With the correct file structure and project metadata you can make your code
288289
installable locally on your computer and use it for projects that you are working
289290
on without having to ever publish to PyPI. Publishing to PyPI is useful when you
@@ -300,25 +301,25 @@ publish it in a repository such as **PyPI** or **conda-forge**.
300301
The links below won't work until those lessons (which are written) are published.
301302
:::
302303

303-
In this tutorial, you will learn [how to publish to PyPI.](6-publish-pypi.md)
304+
Learn [how to publish your package to PyPI in this tutorial.](6-publish-pypi.md)
304305

305306
:::{todo}
306307
This lesson is also not published - yet but will be reviewed soon.
307308
:::
308309

309-
Then you can create a conda-forge recipe using the [grayskull](https://github.com/conda/grayskull) tool. This recipe can then be submitted to conda-forge. [You will learn more about the conda-forge publication process here.](7-publish-conda-forge.md)
310+
Then you can create a conda-forge recipe using the [Grayskull](https://github.com/conda/grayskull) tool. You can then submit this recipe to conda-forge. [You will learn more about the conda-forge publication process here.](7-publish-conda-forge.md)
310311

311312

312313
:::{figure-md} build-workflow-tutorial
313314
<img src="../images/tutorials/publish-package-pypi-conda.png" alt="Graphic showing the high level packaging workflow. On the left you see a graphic with code, metadata and tests in it. Those items all go into your package. Documentation and data are below that box because they aren't normally published in your packaging wheel distribution. an arrow to the right takes you to a build distribution files box. that box leads you to either publishing to testPyPI or the real PyPI. From PyPI you can then connect to conda forge for an automated build that sends distributions from PyPI to conda-forge." width="700px">
314315

315-
In the above image you can see the steps associated with publishing
316-
your package on PyPI and conda forge. Note that the distribution files that PyPI requires are the [sdist](#sdist) and [wheel](#wheel) files. Once you are ready to make your code publicly installable, you can publish it on PyPI. Once your code is on PyPI it is straight forward to then publish to conda forge. You create a recipe using the grayskull package and then you open a pr in the conda-forge recipe repo. You will learn more about this process in the [conda-forge lesson](#).
316+
In the image above, you can see the steps associated with publishing
317+
your package on PyPI and conda forge. Note that the distribution files that PyPI requires are the [sdist](#sdist) and [wheel](#wheel) files. Once you are ready to make your code publicly installable, you can publish it on PyPI. Once your code is on PyPI it is straight forward to then publish to conda forge. You create a recipe using the Grayskull package and then you open a pr in the conda-forge recipe repo. You will learn more about this process in the [conda-forge lesson](#).
317318
:::
318319

319320
## Yay, your package has users! Now what?
320321

321-
As the community using your package grows, you may also find yourself managing users, contributors and others who want to interact with your package. It’s important to consider all this before you dive into development. Once you have a user base in the community, people will depend upon your code to work and will need direction regarding how to use it.
322+
As the community using your package grows, you may also find yourself managing users, contributors, and others who want to interact with your package. It’s important to consider all this before you dive into development. Once you have a user base in the community, people will depend upon your code to work and will need direction regarding how to use it.
322323

323324
To support your community, you'll want to add things like:
324325

@@ -330,13 +331,13 @@ To support your community, you'll want to add things like:
330331

331332
If you intend for others to use and contribute to your code, consider who will maintain it over time. You will want a **contributing and development** guide to help new potential contributors get started with contributing to your package, as well as a **code of conduct** to ensure community interactions remain healthy both for you and your contributors and maintainer team.
332333

333-
The elements above are also important for future maintenance of your package. In the case that you are no long able to maintain it or simply want extra help, development and contributing documentation will help you onboard new maintainers.
334+
The elements above are also important for future maintenance of your package. In the case that you are no long able to maintain it or simply want extra help, development, and contributing documentation will help you onboard new maintainers.
334335
:::
335336

336337
*****
337338

338339
## What's next?
339340

340-
In future lessons we will talk more about the infrastructure around a published Python package that makes it both easier to maintain, easier for others to contribute to and easier for other scientists to use. However, first we want to get you to your initial goal of publishing a Python package.
341+
In future lessons you will learn talk more about the infrastructure around a published Python package that makes it both easier to maintain, easier for others to contribute to and easier for other scientists to use. However, first we want to get you to your initial goal of publishing a Python package.
341342

342343
In this next lesson you will learn how to create a basic installable Python package.

0 commit comments

Comments
 (0)