semvec/pypi-packages huggingface dataset:
pai-soma-data 1.0.3
A class to handle data from a Soma experiment made by Phenomic AI
License: MIT
Requires Python: <3.12,>=3.8

# Pai Soma Data

## Description

This package provides a class, `SomaData`, for handling data from a Soma experiment produced by Phenomic using [TileDBSOMA](https://github.com/single-cell-data/TileDB-SOMA). It allows users to interact with cached observation data as a Pandas DataFrame and retrieve subsets of data as `AnnData` objects, with features to query raw or normalized counts.

## Features

- Load and cache observation (`obs`) and variable (`var`) data from a SOMA experiment.
- Retrieve subsets of data based on specified rows and columns.
- Automatically chooses the appropriate layer (`raw` or `norm`) based on the number of genes requested.
- Converts queried data into `AnnData` format for compatibility with downstream analysis tools.

## Installation

To use this package, you'll need Python 3.8 or later.

```
pip install pai-soma-data
```

## Usage

### Initializing the SomaData Class

To start using the `SomaData` class, initialize it with the URI of your SOMA experiment. You can choose the data layer (`raw` or `norm`) based on your needs:

```
from pai_soma_data import SomaData

# Instantiate SomaData with normalized counts
sdata = SomaData(
    corpus_uri="...",
    layer="norm"  # Change to "raw" for raw counts
)
```

### Accessing Metadata

The observation and gene metadata are stored in the .obs and .var attributes of the SomaData object, respectively. These are accessible as Pandas DataFrames:

```
# View the first few rows of observation metadata
print(sdata.obs.head())

# View the first few rows of variable (gene) metadata
print(sdata.var.head())
```

### Slicing X Data

The SomaData class allows for Pandas-style slicing of data using the format (row_filter, col_filter). The data is fetched in the layer specified during instantiation (default is "norm" for normalized data).

- Row filter: Can be a pd.Series, list of integers, or slices.
- Column filter: Can be a gene name (string) or a list of gene names.

## Contributing

Contributions are welcome! Please fork the repository and submit a pull request for any improvements or bug fixes.

## License

This project is licensed under the MIT License.
rdadccvt 1.6.0
Balzer's algorithm (DCCVT) to find a maximally population compact map
License: MIT
Requires Python: >=3.10

# rdadccvt

Balzer's algorithm (DCCVT) to find a maximally population compact map

## Installation

To clone the repository:

```bash
$ git clone https://github.com/rdatools/rdadccvt
$ cd rdadccvt
```

To install the package:

```bash
$ pip install rdadccvt
```

Then copy the `dccvt` executable from the `bin` directory to the `bin` directory where you installed the package.

## Usage

See the [rdatools/rdaroot](https://github.com/rdatools/rdaroot) and
[rdatools/rdaensemble](https://github.com/rdatools/rdaensemble)
repositories for examples of how to use this package.
The former takes contiguous and 'roughly equal' population maps, and
minimizes the energy (maximizes the population compactness).
The latter uses Balzer's algorithm as part of a multi-step process to
create a contiguous and 'roughly equal' population map from a random
set of starting district centroids.
tabpipe 0.1.1
A toolkit for tabular data ML preprocessing pipelines.
License: MIT
Requires Python: <3.12,>=3.9

# tabpipe

tabpipe is a lightweight, multi-platform toolkit for tabular data processing.


## Things you can do with tabpipe

* Pipelining
  * Use built-in data transformations or create your own
  * Combine those transformations into a Pipeline
  * Train that pipeline on any dataframe (e.g. a Snowpark DataFrame)
  * Use the same pipeline to transform a different type of dataframe at predict time (e.g. a pandas DataFrame)

---
## TODO

### Essential

- Make expensive `fit` methods sample-based (especially those requiring complex parsing)
- Add missing tests (see TODOs in test files)
- Enforce case insensitiveness for feature names
- Improve documentation (when the API is more stable)
  - Improve docstrings
  - Layout (i.e. which modules to include; which info to show;...)
  - Add examples
- Add system for specifying parameters for Features
    - To be used downstream to change how the feature is processed
    - Support different value types, and well-defined sets of values
- Implement streaming pattern

### Nice to have

- Implement multi-threading for pandas transformations (could be useful to reduce latency in realtime inference)
- Port existing Transformation subclasses to PySpark (can be useful for handling user features)
---

## Future Improvements

1. **[High Priority]** Improve `DataFrame` abstraction and make it the de-facto enabler of multi-platform support.

    Right now, there are 2 separate mechanisms that make tabpipe multi-platform: one is the DataFrame abstraction, and the other is the implementation of several fit and transform methods in each data transformation (e.g.`_fit_pandas`, `_fit_snowpark`, `_transform_pandas`, `_transform_snowpark`). This is not ideal, as it makes the code harder to maintain. A better approach would be to have a single implementation for each method in any given transformation, and use the DataFrame abstraction to handle the differences between platforms. This would also make it easier to add support for new platforms in the future.
    - This hasn't been the case so far because that demands a lot of work to develop a solid abstraction layer.
    - If this project gets some traction, this will be one of the top priorities.
2. **[Unclear]** Refactoring `Pipeline` into a `Transformation` subclass.
    - Pros:
        - Conceptually, it makes sense, a pipeline *is* a transformation, and shares many of the same methods/attributes (fit, transform, output, etc).
        - This could eliminate duplicate logic and make the code easier to maintain.
        - Since `Pipeline` is a subclass of `Transformation`, it could be used as a transformation within another pipeline.
    - Cons:
        - This would require substantial refactoring in both `Pipeline` and `Transformation` classes.
---
## Credits

- Project structure created with [Cookiecutter](https://github.com/audreyr/cookiecutter) and the [waynerv/cookiecutter-pypackage](https://github.com/waynerv/cookiecutter-pypackage) project template.
rdabase 2.6.0
Redistricting analytics data
License: MIT
Requires Python: >=3.10

# rdabase
Redistricting analytics data &amp; shared code

## Installation

To get the data locally, clone the repository:

```bash
$ git clone https://github.com/rdatools/rdabase
$ cd rdabase
```

To run the scripts, install the dependencies:

```bash
pip install -r requirements.txt
```

To use the shared code in another project, install the package:

```bash
$ pip install rdabase
```

## Data

The data are stored in the `data` directory by state.
These pages describe each dataset:

- [Data](./docs/data.md): Census and election data by precinct.
- [Shapes](./docs/shapes.md): Shape properties by precinct.
- [Graph](./docs/graph.md): Precinct adjacency graph.

At present, data for [17 states](./docs/states.md) have been extracted.
In the future, we may extract data for other states.

## Code

Some shared code and scripts are described here:

- [Shared Code](./docs/code.md): Common code used in multiple applications.
- [Scripts](./docs/scripts.md): Scripts to re-format the data for specific applications.

## Sources

The data comes from the following sources:

-   The total census population & VAP demographics data comes from the 2020_census_XX-N.csv
    in the DRA [vtd_data](https://github.com/dra2020/vtd_data) GitHub repository, 
    where XX is the state abbreviation and N is the suffix.
    We take the latest version of the data, which is the one with the highest N.
-   The election data comes from the 2020_election_XX-N.csv in the same repo.
-   The shapes are copies of tl_2020_FF_vtd20.zip from [the Census Bureau](https://www2.census.gov/geo/tiger/TIGER2020PL/LAYER/VTD/2020/), 
    where FF is the state FIPS code, e.g., 37 for North Carolina.

Some things to be aware of:

-   If it exists, we use the adjusted population data instead of the official 2020 census total population data. 
-   For Florida, the official VTDs from the Census Bureau are bad. 
    We used DRA's corrected precinct shapes (GeoJSON), removed the intersections, and then converted it to a shapefile.
-   We simplify the precinct shapes (see `extract_shape_data.py`) to approximate the simplification that DRA does, so compactness measurements align.

## Testing

```bash
$ pytest
```