Skip to content

Commit f7fee24

Browse files
committed
Update Python version to 3.12 in documentation and code examples
1 parent c4c9520 commit f7fee24

File tree

8 files changed

+18
-17
lines changed

8 files changed

+18
-17
lines changed

.readthedocs.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ version: 2
77

88
# Set the version of Python and other tools you might need
99
build:
10-
os: ubuntu-22.04
10+
os: ubuntu-24.04
1111
tools:
12-
python: "3.11"
12+
python: "3.12"
1313

1414
# Optionally declare the Python requirements required to build your docs
1515
python:

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ Output: typically summary files
3131

3232
# Usage
3333

34-
Please note that Forest uses Python 3.11. To install, clone this repository to a local directory and then:
34+
Please note that Forest is tested again Python 3.11 and 3.12 only. To install, clone this repository to a local directory and then:
3535

3636
```console
3737
pip install path/to/forest

docs/source/aws.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -593,10 +593,10 @@ to that user.
593593
Assume we are ssh-ed to the EC2 instance.
594594

595595
To create a new environment named `forest_main` with Python version
596-
`3.11` use
596+
`3.12` use
597597

598598
``` sh
599-
conda create --name forest_main python=3.11
599+
conda create --name forest_main python=3.12
600600
```
601601

602602
To activate an environment named `forest_main` use
@@ -678,12 +678,12 @@ base * /opt/anaconda
678678
[Forest](https://github.com/onnela-lab/forest) is a Python library for
679679
analyzing smartphone-based high-throughput digital phenotyping data
680680
collected with the Beiwe platform. Forest implements methods as a Python
681-
3.11 package. Forest is integrated into the Beiwe back-end on AWS but can
681+
3.12 package. Forest is integrated into the Beiwe back-end on AWS but can
682682
also be run locally.
683683

684684
Assume we are ssh-ed to the EC2 instance. Use the commands below to
685685
activate Anaconda environment of choice (here, `forest_main` that has
686-
Python `3.11` installed) and install `git`, `pip`.
686+
Python `3.12` installed) and install `git`, `pip`.
687687

688688
``` sh
689689
conda activate forest_main

docs/source/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ passive-data.md
3232

3333
# Home
3434

35-
Forest is a library for analyzing smartphone-based high-throughput digital phenotyping data collected with the [Beiwe platform](https://www.beiwe.org/). Forest implements methods as a Python 3.11 package. Forest is integrated into the Beiwe back-end on AWS but can also be run locally.
35+
Forest is a library for analyzing smartphone-based high-throughput digital phenotyping data collected with the [Beiwe platform](https://www.beiwe.org/). Forest implements methods as a Python 3.12 package. Forest is integrated into the Beiwe back-end on AWS but can also be run locally.
3636

3737
**Table of Contents**
3838
```{contents}

docs/source/logging.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,4 +358,4 @@ a, b, c = wrapper(x, y, z, 'path/to/log/output/directory')
358358

359359
* [The Python Standard Library's documentation for `logging`](https://docs.python.org/3/library/logging.html)
360360
* Vinay Sajip's [*Logging HOWTO*](https://docs.python.org/3/howto/logging.html)
361-
* [`LogRecord` attributes](https://docs.python.org/3.11/library/logging.html#logrecord-attributes)
361+
* [`LogRecord` attributes](https://docs.python.org/3.12/library/logging.html#logrecord-attributes)

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ classifiers = [
5454
"Operating System :: Microsoft :: Windows",
5555
"Operating System :: POSIX :: Linux",
5656
"Programming Language :: Python :: 3.11",
57+
"Programming Language :: Python :: 3.12",
5758
"Topic :: Scientific/Engineering :: Information Analysis",
5859
]
5960

src/forest/poplar/functions/log.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
# Dictionary of available log record attributes:
1717
# For details, see:
18-
# https://docs.python.org/3.11/library/logging.html#logrecord-attributes
18+
# https://docs.python.org/3.12/library/logging.html#logrecord-attributes
1919
AVAILABLE_ATTRIBUTES = {
2020
"asctime,msecs": "%(asctime)s", # Human-readable time with milliseconds.
2121
"created": "%(created)f", # Unix timestamp (seconds since epoch).
@@ -134,7 +134,7 @@ def log_to_csv(
134134
log_name (str): Name for the log file.
135135
log_format (str): The format argument for logging.basicConfig.
136136
For available attributes and formatting instructions, see:
137-
https://docs.python.org/3.11/library/logging.html#logrecord-attributes
137+
https://docs.python.org/3.12/library/logging.html#logrecord-attributes
138138
header (list): Header for the csv.
139139
140140
Returns:

tutorials/forest_usage.ipynb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
"cell_type": "markdown",
3131
"metadata": {},
3232
"source": [
33-
"Before we begin, we need to check the current distribution of Python. Note that forest is built using Python 3.11. "
33+
"Before we begin, we need to check the current distribution of Python. Note that forest is built using Python 3.12. "
3434
]
3535
},
3636
{
@@ -74,7 +74,7 @@
7474
"source": [
7575
"*The output should display two lines.* \n",
7676
"\n",
77-
"1. The Python version installed: make sure you are not using a version of Python that is earlier than 3.11\n",
77+
"1. The Python version installed: make sure you are not using a version of Python that is earlier than 3.12\n",
7878
"2. The path to where Python is currently installed"
7979
]
8080
},
@@ -709,10 +709,10 @@
709709
"evalue": "name 'response_data' is not defined",
710710
"output_type": "error",
711711
"traceback": [
712-
"\u001B[0;31m---------------------------------------------------------------------------\u001B[0m",
713-
"\u001B[0;31mNameError\u001B[0m Traceback (most recent call last)",
714-
"\u001B[0;32m/var/folders/nl/92kzg8c56mn1872898r7rjr40000gn/T/ipykernel_96458/1316156180.py\u001B[0m in \u001B[0;36m<module>\u001B[0;34m\u001B[0m\n\u001B[1;32m 1\u001B[0m \u001B[0;31m## Make sure the data is sorted according to date\u001B[0m\u001B[0;34m\u001B[0m\u001B[0;34m\u001B[0m\u001B[0m\n\u001B[0;32m----> 2\u001B[0;31m \u001B[0mresponse_data\u001B[0m\u001B[0;34m.\u001B[0m\u001B[0msort_values\u001B[0m\u001B[0;34m(\u001B[0m\u001B[0;34m'Date'\u001B[0m\u001B[0;34m,\u001B[0m \u001B[0minplace\u001B[0m \u001B[0;34m=\u001B[0m \u001B[0;32mTrue\u001B[0m\u001B[0;34m)\u001B[0m\u001B[0;34m\u001B[0m\u001B[0;34m\u001B[0m\u001B[0m\n\u001B[0m\u001B[1;32m 3\u001B[0m \u001B[0mresponse_data\u001B[0m\u001B[0;34m.\u001B[0m\u001B[0mreset_index\u001B[0m\u001B[0;34m(\u001B[0m\u001B[0mdrop\u001B[0m \u001B[0;34m=\u001B[0m \u001B[0;32mTrue\u001B[0m\u001B[0;34m,\u001B[0m \u001B[0minplace\u001B[0m \u001B[0;34m=\u001B[0m \u001B[0;32mTrue\u001B[0m\u001B[0;34m)\u001B[0m\u001B[0;34m\u001B[0m\u001B[0;34m\u001B[0m\u001B[0m\n\u001B[1;32m 4\u001B[0m \u001B[0;34m\u001B[0m\u001B[0m\n\u001B[1;32m 5\u001B[0m \u001B[0;32mdef\u001B[0m \u001B[0mtime_series_plot\u001B[0m\u001B[0;34m(\u001B[0m\u001B[0mvar_to_plot\u001B[0m\u001B[0;34m,\u001B[0m \u001B[0mylab\u001B[0m \u001B[0;34m=\u001B[0m \u001B[0;34m''\u001B[0m\u001B[0;34m,\u001B[0m \u001B[0mxlab\u001B[0m \u001B[0;34m=\u001B[0m \u001B[0;34m'Date'\u001B[0m\u001B[0;34m,\u001B[0m \u001B[0mnum_x_ticks\u001B[0m \u001B[0;34m=\u001B[0m \u001B[0;36m4\u001B[0m\u001B[0;34m)\u001B[0m\u001B[0;34m:\u001B[0m\u001B[0;34m\u001B[0m\u001B[0;34m\u001B[0m\u001B[0m\n",
715-
"\u001B[0;31mNameError\u001B[0m: name 'response_data' is not defined"
712+
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
713+
"\u001b[0;31mNameError\u001b[0m Traceback (most recent call last)",
714+
"\u001b[0;32m/var/folders/nl/92kzg8c56mn1872898r7rjr40000gn/T/ipykernel_96458/1316156180.py\u001b[0m in \u001b[0;36m<module>\u001b[0;34m\u001b[0m\n\u001b[1;32m 1\u001b[0m \u001b[0;31m## Make sure the data is sorted according to date\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 2\u001b[0;31m \u001b[0mresponse_data\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0msort_values\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m'Date'\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0minplace\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;32mTrue\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 3\u001b[0m \u001b[0mresponse_data\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mreset_index\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mdrop\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;32mTrue\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0minplace\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;32mTrue\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 4\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 5\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0mtime_series_plot\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mvar_to_plot\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mylab\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;34m''\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mxlab\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;34m'Date'\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mnum_x_ticks\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;36m4\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
715+
"\u001b[0;31mNameError\u001b[0m: name 'response_data' is not defined"
716716
]
717717
}
718718
],

0 commit comments

Comments
 (0)