MilesCranmer commited on
Commit
3f60d16
1 Parent(s): ec1853e

Improve installation guides on README

Browse files
Files changed (1) hide show
  1. README.md +56 -9
README.md CHANGED
@@ -65,15 +65,62 @@ of this package is to have an open-source symbolic regression tool
65
  as efficient as eureqa, while also exposing a configurable
66
  python interface.
67
 
68
- # Installation
69
 
70
- <div align="center">
 
 
71
 
72
- | pip - **recommended** <br> (works everywhere) | conda <br>(Linux and Intel-based macOS) | docker <br>(if all else fails) |
73
- |---|---|---|
74
- | 1. [Install Julia](https://julialang.org/downloads/)<br>2. Then, run: `pip install -U pysr`<br>3. Finally, to install Julia packages:<br>`python3 -c 'import pysr; pysr.install()'` | `conda install -c conda-forge pysr` | 1. Clone this repo.<br>2. `docker build -t pysr .`<br>Run with:<br>`docker run -it --rm pysr ipython`
75
 
76
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
77
 
78
  Common issues tend to be related to Python not finding Julia.
79
  To debug this, try running `python3 -c 'import os; print(os.environ["PATH"])'`.
@@ -81,7 +128,7 @@ If none of these folders contain your Julia binary, then you need to add Julia's
81
 
82
  **Running PySR on macOS with an M1 processor:** you should use the pip version, and make sure to get the Julia binary for ARM/M-series processors.
83
 
84
- # Introduction
85
 
86
  You might wish to try the interactive tutorial [here](https://colab.research.google.com/github/MilesCranmer/PySR/blob/master/examples/pysr_demo.ipynb), which uses the notebook in `examples/pysr_demo.ipynb`.
87
 
@@ -186,7 +233,7 @@ For a detailed look at more options, see the [options page](https://astroautomat
186
  You can also see the full API at [this page](https://astroautomata.com/PySR/api).
187
  There are also tips for tuning PySR on [this page](https://astroautomata.com/PySR/tuning).
188
 
189
- ## Detailed Example
190
 
191
  The following code makes use of as many PySR features as possible.
192
  Note that is just a demonstration of features and you should not use this example as-is.
@@ -265,7 +312,7 @@ model = PySRRegressor(
265
  )
266
  ```
267
 
268
- # Docker
269
 
270
  You can also test out PySR in Docker, without
271
  installing it locally, by running the following command in
 
65
  as efficient as eureqa, while also exposing a configurable
66
  python interface.
67
 
68
+ ## Installation
69
 
70
+ | [pip](#pip) | [conda](#conda) | [docker](#docker-build) |
71
+ |:---:|:---:|:---:|
72
+ | Everywhere (recommended) | Linux and Intel-based macOS | Everywhere (if all else fails) |
73
 
74
+ ---
 
 
75
 
76
+ ### pip
77
+
78
+ 1. [Install Julia](https://julialang.org/downloads/)
79
+ - Alternatively, my personal preference is to use [juliaup](https://github.com/JuliaLang/juliaup#installation), which performs this automatically.
80
+ 2. Then, run:
81
+ ```bash
82
+ pip install -U pysr
83
+ ```
84
+ 3. Finally, to install Julia dependencies:
85
+ ```bash
86
+ python3 -c 'import pysr; pysr.install()'
87
+ ```
88
+
89
+ ---
90
+
91
+ ### conda
92
+
93
+ The PySR build in conda includes all required dependencies, so you can install it by simply running:
94
+
95
+ ```bash
96
+ conda install -c conda-forge pysr
97
+ ```
98
+
99
+ in your desired environment.
100
+
101
+ However, note that the conda install does not support precompilation of Julia libraries, so the
102
+ start time may be slightly slower as the JIT-compilation will be running.
103
+ (Once the compilation finishes, there will not be a performance difference though.)
104
+
105
+ ---
106
+
107
+ ### docker build
108
+
109
+ 1. Clone this repo.
110
+ 2. In the repo, run the build command with:
111
+ ```bash
112
+ docker build -t pysr .
113
+ ```
114
+ 3. You can then start the container with an IPython execution with:
115
+ ```bash
116
+ docker run -it --rm pysr ipython
117
+ ```
118
+
119
+ For more details, see the [docker section](#docker).
120
+
121
+ ---
122
+
123
+ ### Common issues
124
 
125
  Common issues tend to be related to Python not finding Julia.
126
  To debug this, try running `python3 -c 'import os; print(os.environ["PATH"])'`.
 
128
 
129
  **Running PySR on macOS with an M1 processor:** you should use the pip version, and make sure to get the Julia binary for ARM/M-series processors.
130
 
131
+ ## Introduction
132
 
133
  You might wish to try the interactive tutorial [here](https://colab.research.google.com/github/MilesCranmer/PySR/blob/master/examples/pysr_demo.ipynb), which uses the notebook in `examples/pysr_demo.ipynb`.
134
 
 
233
  You can also see the full API at [this page](https://astroautomata.com/PySR/api).
234
  There are also tips for tuning PySR on [this page](https://astroautomata.com/PySR/tuning).
235
 
236
+ ### Detailed Example
237
 
238
  The following code makes use of as many PySR features as possible.
239
  Note that is just a demonstration of features and you should not use this example as-is.
 
312
  )
313
  ```
314
 
315
+ ## Docker
316
 
317
  You can also test out PySR in Docker, without
318
  installing it locally, by running the following command in