Skip to content

Commit

Permalink
Using <details> to make the docs easier to read
Browse files Browse the repository at this point in the history
  • Loading branch information
emeryberger authored Feb 24, 2023
1 parent 25f92f0 commit b6b3ca1
Showing 1 changed file with 23 additions and 4 deletions.
27 changes: 23 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,10 @@ conda install -c conda-forge scalene

#### Using Scalene:

<details>
<summary>
Commonly used options:
</summary>

```console
scalene your_prog.py # full profile (outputs to web interface)
Expand All @@ -68,7 +71,14 @@ scalene (Scalene options) --- your_prog.py (...) # use --- to tell Scalene to ig
scalene --help # lists all options
```

To use Scalene programmatically in your code, invoke using `scalene` as above and then:
</details>

<details>
<summary>
Using Scalene programmatically in your code:
</summary>

Invoke using `scalene` as above and then:

```Python
from scalene import scalene_profiler
Expand All @@ -80,7 +90,14 @@ scalene_profiler.start()
scalene_profiler.stop()
```

To use Scalene to profile specific functions, just use the `@profile` decorator and run it with Scalene:
</details>

<details>
<summary>
Using Scalene to profile only specific functions via <code>@profile</code>:
</summary>

Just preface any functions you want to profile with the `@profile` decorator and run it with Scalene:

```Python
# do not import profile!
Expand All @@ -91,6 +108,8 @@ def slow_function():
time.sleep(3)
```

</details>

#### Web-based GUI

Scalene has both a CLI and a web-based GUI [(demo here)](http://plasma-umass.org/scalene-gui/).
Expand Down Expand Up @@ -191,7 +210,7 @@ it `--profile-all` and only include files with at least a
* **"timeline / %"**: Visualized by "sparklines", memory consumption generated by this line over the program runtime, and the percentages of total memory activity this line represents.
* **"Copy (MB/s)"**: The amount of megabytes being copied per second (see "About Scalene").

## Using Scalene
## Scalene

The following command runs Scalene on a provided example program.

Expand Down Expand Up @@ -292,7 +311,7 @@ code...

## Installation

<details open>
<details>
<summary>Using <code>pip</code> (Mac OS X, Linux, Windows, and WSL2)</summary>

Scalene is distributed as a `pip` package and works on Mac OS X, Linux (including Ubuntu in [Windows WSL2](https://docs.microsoft.com/en-us/windows/wsl/wsl2-index)) and (with limitations) Windows platforms. (**Note**: the Windows version isn't yet complete; it currently only supports CPU profiling.)
Expand Down

0 comments on commit b6b3ca1

Please sign in to comment.