scatterscale 0.0.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- scatterscale-0.0.1/PKG-INFO +17 -0
- scatterscale-0.0.1/README.md +2 -0
- scatterscale-0.0.1/pyproject.toml +28 -0
- scatterscale-0.0.1/scatterscale/__init__.py +0 -0
- scatterscale-0.0.1/scatterscale/outliers.py +46 -0
- scatterscale-0.0.1/scatterscale.egg-info/PKG-INFO +17 -0
- scatterscale-0.0.1/scatterscale.egg-info/SOURCES.txt +9 -0
- scatterscale-0.0.1/scatterscale.egg-info/dependency_links.txt +1 -0
- scatterscale-0.0.1/scatterscale.egg-info/requires.txt +4 -0
- scatterscale-0.0.1/scatterscale.egg-info/top_level.txt +1 -0
- scatterscale-0.0.1/setup.cfg +4 -0
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: scatterscale
|
|
3
|
+
Version: 0.0.1
|
|
4
|
+
Summary: Automatically determine the best scaling for your scatterplot's colorbar.
|
|
5
|
+
Author-email: Juliana Karp <jsmkarp@uw.edu>, Anavi Uppal <anuppal@ucsc.edu>
|
|
6
|
+
Maintainer-email: Juliana Karp <jsmkarp@uw.edu>, Anavi Uppal <anuppal@ucsc.edu>
|
|
7
|
+
License-Expression: MIT
|
|
8
|
+
Project-URL: Repository, https://github.com/juliana-karp/scatterscale.git
|
|
9
|
+
Requires-Python: >=3.8
|
|
10
|
+
Description-Content-Type: text/markdown
|
|
11
|
+
Requires-Dist: numpy
|
|
12
|
+
Requires-Dist: matplotlib
|
|
13
|
+
Requires-Dist: scipy
|
|
14
|
+
Requires-Dist: pandas
|
|
15
|
+
|
|
16
|
+
# scatterscale
|
|
17
|
+
automate the choice of normalizing scale for your scatterplot's colorbar
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools >= 77.0.3"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "scatterscale"
|
|
7
|
+
version = "0.0.1"
|
|
8
|
+
dependencies = [
|
|
9
|
+
"numpy",
|
|
10
|
+
"matplotlib",
|
|
11
|
+
"scipy",
|
|
12
|
+
"pandas",
|
|
13
|
+
]
|
|
14
|
+
requires-python = ">= 3.8"
|
|
15
|
+
authors = [
|
|
16
|
+
{name = "Juliana Karp", email = "jsmkarp@uw.edu"},
|
|
17
|
+
{name = "Anavi Uppal", email = "anuppal@ucsc.edu"},
|
|
18
|
+
]
|
|
19
|
+
maintainers = [
|
|
20
|
+
{name = "Juliana Karp", email = "jsmkarp@uw.edu"},
|
|
21
|
+
{name = "Anavi Uppal", email = "anuppal@ucsc.edu"},
|
|
22
|
+
]
|
|
23
|
+
readme = "README.md"
|
|
24
|
+
description = "Automatically determine the best scaling for your scatterplot's colorbar."
|
|
25
|
+
license = "MIT"
|
|
26
|
+
|
|
27
|
+
[project.urls]
|
|
28
|
+
Repository = "https://github.com/juliana-karp/scatterscale.git"
|
|
File without changes
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import numpy as np
|
|
2
|
+
|
|
3
|
+
def handle_outliers(dist, sigma_value=10, treatment='reassign'):
|
|
4
|
+
"""
|
|
5
|
+
Function to identify and handle outlier values in the distribution,
|
|
6
|
+
which would drastically change the scaling of the colorbar if not addressed.
|
|
7
|
+
|
|
8
|
+
Inputs
|
|
9
|
+
-------
|
|
10
|
+
dist: 1d float array
|
|
11
|
+
data to be represented by the colorbar.
|
|
12
|
+
sigma_value: int, default 10
|
|
13
|
+
number of stddev to use when identifying outliers, if using the sigma method.
|
|
14
|
+
treatment: str, default='reassign'
|
|
15
|
+
how to treat the identified outliers. options are 'reassign' and 'mask_out'.
|
|
16
|
+
|
|
17
|
+
Outputs
|
|
18
|
+
-------
|
|
19
|
+
modified_dist: 1d float array
|
|
20
|
+
data to be represented by the colorbar, treated for outliers according to the specifications.
|
|
21
|
+
"""
|
|
22
|
+
|
|
23
|
+
median = np.median(dist)
|
|
24
|
+
# center the gaussian at the median of the distribution
|
|
25
|
+
stddev = np.std(dist, mean=median)
|
|
26
|
+
|
|
27
|
+
lower_bound = median - sigma_value * stddev
|
|
28
|
+
upper_bound = median + sigma_value * stddev
|
|
29
|
+
|
|
30
|
+
upper_outliers = dist > upper_bound
|
|
31
|
+
lower_outliers = dist < lower_bound
|
|
32
|
+
|
|
33
|
+
# choose the method to treat outliers
|
|
34
|
+
|
|
35
|
+
if treatment == 'reassign':
|
|
36
|
+
|
|
37
|
+
# make a deep copy
|
|
38
|
+
dist_modified = np.copy(dist)
|
|
39
|
+
dist_modified[upper_outliers] = upper_bound
|
|
40
|
+
dist_modified[lower_outliers] = lower_bound
|
|
41
|
+
|
|
42
|
+
elif treatment == 'mask_out':
|
|
43
|
+
|
|
44
|
+
dist_modified = dist[~upper_outliers & ~lower_outliers]
|
|
45
|
+
|
|
46
|
+
return dist_modified
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: scatterscale
|
|
3
|
+
Version: 0.0.1
|
|
4
|
+
Summary: Automatically determine the best scaling for your scatterplot's colorbar.
|
|
5
|
+
Author-email: Juliana Karp <jsmkarp@uw.edu>, Anavi Uppal <anuppal@ucsc.edu>
|
|
6
|
+
Maintainer-email: Juliana Karp <jsmkarp@uw.edu>, Anavi Uppal <anuppal@ucsc.edu>
|
|
7
|
+
License-Expression: MIT
|
|
8
|
+
Project-URL: Repository, https://github.com/juliana-karp/scatterscale.git
|
|
9
|
+
Requires-Python: >=3.8
|
|
10
|
+
Description-Content-Type: text/markdown
|
|
11
|
+
Requires-Dist: numpy
|
|
12
|
+
Requires-Dist: matplotlib
|
|
13
|
+
Requires-Dist: scipy
|
|
14
|
+
Requires-Dist: pandas
|
|
15
|
+
|
|
16
|
+
# scatterscale
|
|
17
|
+
automate the choice of normalizing scale for your scatterplot's colorbar
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
README.md
|
|
2
|
+
pyproject.toml
|
|
3
|
+
scatterscale/__init__.py
|
|
4
|
+
scatterscale/outliers.py
|
|
5
|
+
scatterscale.egg-info/PKG-INFO
|
|
6
|
+
scatterscale.egg-info/SOURCES.txt
|
|
7
|
+
scatterscale.egg-info/dependency_links.txt
|
|
8
|
+
scatterscale.egg-info/requires.txt
|
|
9
|
+
scatterscale.egg-info/top_level.txt
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
scatterscale
|