Skip to content

Commit

Permalink
maint: update URLs for Lifemap-ToL organisation
Browse files Browse the repository at this point in the history
  • Loading branch information
juba committed Jun 17, 2024
1 parent b1a3ffd commit 5d87c0c
Show file tree
Hide file tree
Showing 13 changed files with 41 additions and 40 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# pylifemap

[![PyPI](https://img.shields.io/pypi/v/pylifemap.svg?color=green)](https://pypi.org/project/pylifemap)
[![Tests](https://github.com/juba/pylifemap/actions/workflows/tests.yml/badge.svg)](https://github.com/juba/pylifemap/actions/workflows/tests.yml)
[![Documentation](https://github.com/juba/pylifemap/actions/workflows/publish.yml/badge.svg)](https://github.com/juba/pylifemap/actions/workflows/publish.yml)
[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/juba/pylifemap/blob/master/notebooks/introduction.ipynb)
[![Tests](https://github.com/Lifemap-ToL/pylifemap/actions/workflows/tests.yml/badge.svg)](https://github.com/Lifemap-ToL/pylifemap/actions/workflows/tests.yml)
[![Documentation](https://github.com/Lifemap-ToL/pylifemap/actions/workflows/publish.yml/badge.svg)](https://github.com/Lifemap-ToL/pylifemap/actions/workflows/publish.yml)
[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/Lifemap-ToL/pylifemap/blob/master/notebooks/introduction.ipynb)

Python package for Lifemap visualizations.

Documentation: <https://juba.github.io/pylifemap>
Documentation: <https://lifemap-tol.github.io/pylifemap>
6 changes: 3 additions & 3 deletions doc/_quarto.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ execute:

website:
title: "pylifemap"
site-url: "https://juba.github.io/pylifemap"
site-url: "https://lifemap-tol.github.io/pylifemap"
favicon: favicon.png
repo-url: https://github.com/juba/pylifemap/
repo-url: https://github.com/Lifemap-ToL/pylifemap/
repo-subdir: "doc"
repo-actions: [issue]
search:
Expand All @@ -35,7 +35,7 @@ website:
- development.qmd
tools:
- icon: github
href: https://github.com/juba/pylifemap/
href: https://github.com/Lifemap-ToL/pylifemap/

metadata-files:
- _quartodoc_sidebar.yml
Expand Down
4 changes: 2 additions & 2 deletions doc/development.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ title: "Development notes"
To install `pylifemap` from git:

```sh
pip install git+https://github.com/juba/pylifemap.git
pip install git+https://github.com/Lifemap-ToL/pylifemap.git
```

## Install fom source
Expand All @@ -17,7 +17,7 @@ If you want to build `pylifemap` from source, you'll have to follow these steps:

- Install [node.js](https://nodejs.org/en)
- Install [hatch](https://hatch.pypa.io/latest/) dependency management system
- Clone the [pylifemap](https://github.com/juba/pylifemap) repository
- Clone the [pylifemap](https://github.com/Lifemap-ToL/pylifemap) repository
- Install Python dependencies with : `hatch shell`
- Install JavaScript dependencies with : `npm install --workspaces --include-root-workspace`

Expand Down
4 changes: 2 additions & 2 deletions doc/getting_started.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ We can import it as a polars or pandas DataFrame with the following code:
import polars as pl
iucn = pl.read_csv(
"https://raw.githubusercontent.com/juba/pylifemap/main/data/iucn.csv"
"https://raw.githubusercontent.com/Lifemap-ToL/pylifemap/main/data/iucn.csv"
)
```

Expand All @@ -39,7 +39,7 @@ iucn = pl.read_csv(
import pandas as pd
iucn = pd.read_csv(
"https://raw.githubusercontent.com/juba/pylifemap/main/data/iucn.csv"
"https://raw.githubusercontent.com/Lifemap-ToL/pylifemap/main/data/iucn.csv"
)
```

Expand Down
2 changes: 1 addition & 1 deletion doc/index.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ from pylifemap import Lifemap
# Load iucn dataset
iucn = pd.read_csv(
"https://raw.githubusercontent.com/juba/pylifemap/main/data/iucn.csv"
"https://raw.githubusercontent.com/Lifemap-ToL/pylifemap/main/data/iucn.csv"
)
Lifemap(iucn).layer_points(radius=5, opacity=0.1).show()
Expand Down
10 changes: 5 additions & 5 deletions doc/installation.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -19,26 +19,26 @@ You can install the package locally (preferably in a virtual environment) with [
For the moment only the development version can be installed from Github with the following command:

```shell
pip install git+https://github.com/juba/pylifemap.git
pip install git+https://github.com/Lifemap-ToL/pylifemap.git
```

## Run in Google Colab

You can try the package (without installing anything) in [Google Colab](https://colab.research.google.com/).

The easiest way is by using our [introduction notebook](https://colab.research.google.com/github/juba/pylifemap/blob/master/notebooks/introduction.ipynb) directly in Colab: [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/juba/pylifemap/blob/master/notebooks/introduction.ipynb).
The easiest way is by using our [introduction notebook](https://colab.research.google.com/github/Lifemap-ToL/pylifemap/blob/master/notebooks/introduction.ipynb) directly in Colab: [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/Lifemap-ToL/pylifemap/blob/master/notebooks/introduction.ipynb).


## Run with Docker

### Run in Jupyter

Another way to use the package without having to install it is to use our [Docker image](https://github.com/juba/pylifemap/pkgs/container/pylifemap).
Another way to use the package without having to install it is to use our [Docker image](https://github.com/Lifemap-ToL/pylifemap/pkgs/container/pylifemap).

To use `pylifemap` in a Jupyter environment, you have to [install Docker](https://docs.docker.com/engine/install/), open a terminal in the directory containing your data and notebook files, and run:

```sh
docker run -it -p 8899:8899 -v $PWD:/local/ ghcr.io/juba/pylifemap:latest
docker run -it -p 8899:8899 -v $PWD:/local/ ghcr.io/Lifemap-ToL/pylifemap:latest
```

Open the following URL in your browser: <http://127.0.0.1:8899/lab>, and you will have access to a Jupyter notebook environment with `pylifemap` and its dependencies preinstalled.
Expand All @@ -48,7 +48,7 @@ Open the following URL in your browser: <http://127.0.0.1:8899/lab>, and you wil
If you just want to run a Python script generating a pylifemap visualization, you can open a terminal in the script directory and run the following command:

```sh
docker run -v $PWD:/local/ ghcr.io/juba/pylifemap:latest myscript.py
docker run -v $PWD:/local/ ghcr.io/Lifemap-ToL/pylifemap:latest myscript.py
```

In this case, if you use [show()](`~pylifemap.Lifemap.show`) in your script the result will not be opened in your browser but will instead be saved in a `lifemap.html` file in your working directory.
2 changes: 1 addition & 1 deletion doc/layers/layer_donuts.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ from pylifemap import Lifemap, aggregate_freq
# Load iucn dataset
iucn = pl.read_csv(
"https://raw.githubusercontent.com/juba/pylifemap/main/data/iucn.csv"
"https://raw.githubusercontent.com/Lifemap-ToL/pylifemap/main/data/iucn.csv"
)
# Aggregate observations count along branches
Expand Down
2 changes: 1 addition & 1 deletion doc/layers/layer_heatmap.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ from pylifemap import Lifemap
# Load iucn dataset
iucn = pl.read_csv(
"https://raw.githubusercontent.com/juba/pylifemap/main/data/iucn.csv"
"https://raw.githubusercontent.com/Lifemap-ToL/pylifemap/main/data/iucn.csv"
)
(
Expand Down
2 changes: 1 addition & 1 deletion doc/layers/layer_lines.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ from pylifemap import Lifemap, aggregate_count
# Load iucn dataset
iucn = pl.read_csv(
"https://raw.githubusercontent.com/juba/pylifemap/main/data/iucn.csv"
"https://raw.githubusercontent.com/Lifemap-ToL/pylifemap/main/data/iucn.csv"
)
# Aggregate observations count along branches
Expand Down
2 changes: 1 addition & 1 deletion doc/layers/layer_points.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ from pylifemap import Lifemap, aggregate_count
# Load iucn dataset
iucn = pl.read_csv(
"https://raw.githubusercontent.com/juba/pylifemap/main/data/iucn.csv"
"https://raw.githubusercontent.com/Lifemap-ToL/pylifemap/main/data/iucn.csv"
)
# Aggregate observations count along branches
Expand Down
2 changes: 1 addition & 1 deletion doc/layers/layer_screengrid.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ from pylifemap import Lifemap
# Load iucn dataset
iucn = pl.read_csv(
"https://raw.githubusercontent.com/juba/pylifemap/main/data/iucn.csv"
"https://raw.githubusercontent.com/Lifemap-ToL/pylifemap/main/data/iucn.csv"
)
(
Expand Down
30 changes: 15 additions & 15 deletions notebooks/introduction.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"\n",
"## Installation\n",
"\n",
"For the moment the package is only available on Github. You can install it by running the following code:"
"For the moment the package is only available on Github. You can install it by running the following code:\n"
]
},
{
Expand All @@ -21,7 +21,7 @@
"metadata": {},
"outputs": [],
"source": [
"%pip install git+https://github.com/juba/pylifemap.git"
"%pip install git+https://github.com/Lifemap-ToL/pylifemap.git"
]
},
{
Expand All @@ -32,7 +32,7 @@
"\n",
"In this notebook we will use a sample data file generated from [The IUCN Red List of Threatened Species](https://www.gbif.org/dataset/19491596-35ae-4a91-9a98-85cf505f1bd3). It is a CSV file with the Red List category (in 2022) of more than 84000 species.\n",
"\n",
"We can load the file with the pandas or polars data frame libraries:"
"We can load the file with the pandas or polars data frame libraries:\n"
]
},
{
Expand All @@ -44,15 +44,15 @@
"import polars as pl\n",
"\n",
"iucn = pl.read_csv(\n",
" \"https://raw.githubusercontent.com/juba/pylifemap/main/data/iucn.csv\"\n",
" \"https://raw.githubusercontent.com/Lifemap-ToL/pylifemap/main/data/iucn.csv\"\n",
")"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"The data set only contains two variables: the `taxid` of the species, and its `status`:"
"The data set only contains two variables: the `taxid` of the species, and its `status`:\n"
]
},
{
Expand All @@ -68,7 +68,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"Besides the full `iucn` dataset, we will create another `iucn_extinct` object with only the species with the \"Extinct\" status."
"Besides the full `iucn` dataset, we will create another `iucn_extinct` object with only the species with the \"Extinct\" status.\n"
]
},
{
Expand All @@ -89,7 +89,7 @@
"\n",
"We will first try to visualize the distribution of the species in `iucn_extinct`.\n",
"\n",
"The first thing we have to do is to create a new `Lifemap` instance by passing it our data:"
"The first thing we have to do is to create a new `Lifemap` instance by passing it our data:\n"
]
},
{
Expand All @@ -107,7 +107,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"To visualize our data we have to add a *layer* to our `Lifemap` object. Here we can use `layer_points`, which displays each species with a colored point. We also call the `show()` method to display the result."
"To visualize our data we have to add a _layer_ to our `Lifemap` object. Here we can use `layer_points`, which displays each species with a colored point. We also call the `show()` method to display the result.\n"
]
},
{
Expand All @@ -123,7 +123,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"Another interesting layer for species distribution is `layer_heatmap`:"
"Another interesting layer for species distribution is `layer_heatmap`:\n"
]
},
{
Expand All @@ -141,7 +141,7 @@
"source": [
"In our dataset we have a list of extinct species which are \"leaves\" of the tree. One thing we can do is compute the frequency of extinct species for each tree node, by aggregating the count along the branches.\n",
"\n",
"We can compute this by using the `aggregate_count` function on our data:"
"We can compute this by using the `aggregate_count` function on our data:\n"
]
},
{
Expand All @@ -160,7 +160,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"We can visualize this new dataset with a `layer_points`. But it is more interesting visually if we make the size and the color of the points depend on their associated count. This is possible by using the `radius_col` and `fill_col` arguments:"
"We can visualize this new dataset with a `layer_points`. But it is more interesting visually if we make the size and the color of the points depend on their associated count. This is possible by using the `radius_col` and `fill_col` arguments:\n"
]
},
{
Expand All @@ -176,7 +176,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"And we can add a second layer to also color the branches depending on the species frequencies:"
"And we can add a second layer to also color the branches depending on the species frequencies:\n"
]
},
{
Expand Down Expand Up @@ -217,7 +217,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"Another possibility is to make another aggregation along the tree branches, this time to compute the frequencies of the different statuses at each node. This can ben done with the `aggregate_cat` function."
"Another possibility is to make another aggregation along the tree branches, this time to compute the frequencies of the different statuses at each node. This can ben done with the `aggregate_cat` function.\n"
]
},
{
Expand All @@ -235,7 +235,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"We can then visualize this data as a series of donut charts. You can click on a chart to display a popup with more informations:"
"We can then visualize this data as a series of donut charts. You can click on a chart to display a popup with more informations:\n"
]
},
{
Expand Down Expand Up @@ -264,7 +264,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.7"
"version": "3.12.2"
}
},
"nbformat": 4,
Expand Down
7 changes: 4 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,16 @@ dependencies = [
"pandas",
"pyarrow>=15.0.0",
"ipywidgets>=8.1.0",
"pickleshare>=0.7.5"
]

[project.optional-dependencies]
dev = ["watchfiles", "jupyterlab"]

[project.urls]
Documentation = "https://github.com/juba/pylifemap#readme"
Issues = "https://github.com/juba/pylifemap/issues"
Source = "https://github.com/juba/pylifemap"
Documentation = "https://github.com/Lifemap-ToL/pylifemap#readme"
Issues = "https://github.com/Lifemap-ToL/pylifemap/issues"
Source = "https://github.com/Lifemap-ToL/pylifemap"

[tool.hatch.version]
path = "src/pylifemap/__about__.py"
Expand Down

0 comments on commit 5d87c0c

Please sign in to comment.