semvec/pypi-packages huggingface dataset:
cohdl-yosys 0.2.4
Formal verification support library for CoHDL
Requires Python: >=3.11

# cohdl_yosys

cohdl_yosys is a small Python library that adds formal verification support to the [CoHDL](https://github.com/alexander-forster/cohdl) hardware description language. 

It consists of two main components:

* a module of utility functions to describe formal properties of hardware designs

    These functions use the inline code feature of CoHDL to embed PSL statements into the generated VHDL representation.
    
* an abstaction layer to define SymbiYosys projects as Python classes

    The verification tools can either be invoked directly or via the Python unittest module. This allows for easy test automation and IDE integration.

The library is not limited to CoHDL designs. It is also possible to verify VHDL code.

## documentation

The documentation of cohdl_yosys can be found in the [cohdl_documentation](https://github.com/alexander-forster/cohdl_documentation) repo.

## installation

cohdl_yosys itself is available as a pip package and can installed with:

```
pip install cohdl_yosys
```

Since the library relies on [GHDL](https://github.com/ghdl/ghdl), [SymbiYosys](https://github.com/YosysHQ/sby) and the [ghdl-yosys-plugin](https://github.com/ghdl/ghdl-yosys-plugin) to perform the actual verification, these components and their dependencies need to be installed too. You can use the Dockerfile in the [cohdl_documentation](https://github.com/alexander-forster/cohdl_documentation) repo as a reference or work with the cohdl docker image directly.
simplelens 1.2.1
Implementation of the lens functional pattern
Requires Python: >=3.11

# Lens 1.2.1

## Purpose

The purpose of this project is to implement the "Lens" functional pattern in Python and supply that implementation as a package that can be imported into any other python project.


## Install

    pip install simplelens

## Uninstall

    pip uninstall simplelens

## Usage
Install the package from PyPi via pip install  
`import lens`

The lens function expects a collection of some form, as well as a list of keys and/or indexes to use to extract data 
from the collection.

    collection = {'a': {'b': [{'a': 1}, {'b': 2}, {'c': 3}]
    lens.focus(collection, ['a', 'b', 2, 'c'])
    #=> 3

Also a feature is returning a tuple of multiple key sequences.

    collection = {'a': {'b': [{'a': 1}, {'b': 2}, {'c': 3}]
    lens.multi_focus(collection, (['a', 'b', 2, 'c'], ['a', 'b', 0, 'a']))
    #=> (3, 1)


## Changelog
  See changelog here: [Changelog.md](changelog.md)


## License

Copyright 2024 Nathan Menge - nathan.menge@gmail.com

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS
OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
pwlreg 1.0.3
A scikit-learn-compatible implementation of Piecewise Linear Regression
Keywords: change point, piecewise regression, scikit-learn, sklearn

# pwlreg

[![Tests](https://github.com/ensley-nexant/pwlreg/actions/workflows/tests.yml/badge.svg)](https://github.com/ensley-nexant/pwlreg/actions/workflows/tests.yml)
[![codecov](https://codecov.io/gh/ensley-nexant/pwlreg/branch/main/graph/badge.svg?token=x8l1hx77eL)](https://codecov.io/gh/ensley-nexant/pwlreg)

A scikit-learn-compatible implementation of Piecewise Linear Regression

## Installation

```
pip install pwlreg
```

## Documentation

[See the documentation here](https://ensley-nexant.github.io/pwlreg/).


```python
import numpy as np
import matplotlib.pyplot as plt

import pwlreg as pw


x = np.array([1., 2., 3., 4., 5., 6., 7., 8., 9., 10.])
y = np.array([1., 1.5, 0.5, 1., 1.25, 2.75, 4, 5.25, 6., 8.5])

m = pw.AutoPiecewiseRegression(n_segments=2, degree=[0, 1])
m.fit(x, y)

xx = np.linspace(1, 10, 100)
plt.plot(x, y, "o")
plt.plot(xx, m.predict(xx), "-")
plt.show()
```

![pwlreg toy example](docs/img/img.png)

```python
m.coef_         # [ 1.00  -5.50  1.35 ]
m.breakpoints_  # [ 1.000000  4.814815  10.000000 ]
```

$$
x =
\begin{cases}
1,            & 1 \leq x < 4.815 \\
-5.5 + 1.35x, & 4.815 \leq x < 10
\end{cases}
$$
transformative-harmonization 0.2.2
A Python library for Transformative Harmonization, a novel similarity metric
Requires Python: >=3.7

Transformative Harmonization
A Python library for Transformative Harmonization, a novel mathematical operation designed by Zayn. This operation combines numbers, vectors, or matrices in a context-aware, harmonious manner, offering a new similarity metric for data science and machine learning applications.
Features

Harmonization of numbers, vectors, and matrices with customizable context parameters.
Optimized for machine learning tasks (clustering, classification, recommendation systems).
Comprehensive mathematical properties (commutativity, continuity) and unit tests.
Extensive documentation with practical examples.
MIT licensed for open-source use.

Installation
Install via pip:
pip install transformative-harmonization

Published on PyPI: https://pypi.org/project/transformative-harmonization/


Quick Start
Basic Harmonization (Numbers)
from transformative_harmonization import TransformativeHarmonization

th = TransformativeHarmonization(context={'weight': 1.0, 'scale': 1.0})
result = th.harmonize(3, 4)
print(result)  # Output: ~3.50

Vector Harmonization (Machine Learning)
import numpy as np
from transformative_harmonization import VectorHarmonization

vh = VectorHarmonization(context={'weight': 1.0, 'scale': 1.0})
v1 = np.array([1, 0])
v2 = np.array([0, 1])
result = vh.harmonize(v1, v2)
print(result)  # Output: Harmonized vector

Custom Harmonization
from transformative_harmonization import CustomHarmonization

def custom_harmony(a, b, context):
    return context['scale'] * (a + b) / 2
ch = CustomHarmonization(custom_harmony, context={'scale': 2.0})
result = ch.harmonize(3, 5)
print(result)  # Output: 8.0

Running Tests
To run the unit tests:
pip install numpy scikit-learn
python -m unittest discover tests

Documentation
Full documentation is available at Read the Docs.
Mathematical Properties

Commutative: Yes (H(a, b) = H(b, a)).
Associative: No (H(H(a, b), c) â‰  H(a, H(b, c))).
Continuous: Yes for all inputs except a + b = 0.
Contextual: Adjustable via weight and scale parameters.

Contributing
Contributions are welcome! Please:

Fork the repository.
Create

 a feature branch.3. Submit a pull request with clear documentation and tests.
See CONTRIBUTING.md for details.
License
This project is licensed under the MIT License. See the LICENSE file for details.
Contact
For questions or feedback, please open an issue on GitHub or contact Zayn.
ElectroAnatomyCloud 0.1.0
Tools for processing and visualizing electroanatomic cardiac mesh data
Requires Python: >=3.9

A package for processing data of electroanatomical mappings from the Carto3D system and aligning them with binary segmentations of MRI or CT.

Inputs should be .mesh filetypes, and for voltage data, should be a series of .xmls, one for each point in the .mesh. The system will attempt to automatically find and label these points with either bipolar or unipolar voltages. The package offers a suite of prealignment tools, including center of mass matching and PCA with long axis matching. Alignment happens in the point cloud space. Once aligned, the file can be returned to a sitk via the function mesh_to_sitk. 

Examples of the SimpleITK visualization and PointCloud class visualization.

SITK
![](https://github.com/slostett/ElectroAnatomyCloud/blob/main/sitk.png)
PointCloud
![](https://github.com/slostett/ElectroAnatomyCloud/blob/main/cloud.png)

I can't post any of the EAMs or alignment data here since it's PHI. The data above is from an open source CT I segmented using totalsegmentator. If anyone has open source EAM data, let me know and I will process and add it here.

Example Usage of the CLI (recommended for simple use cases):
```
py align_mesh.py `
 --meshpath "C:/Users/steph/Documents/UNC Cardiac Imaging/EAM data/ExportData28_02_25 16_19_56/Patient 2025_02_28/AF/Export_AF-02_28_2025-16-01-43/6-1-sinus.mesh" `
 --segpath "C:/Users/steph/Downloads/Sorted_0_6_channel0.nii" `
 --output_path "C:/users/steph/Documents/UNC Cardiac Imaging/results/EAM.nii.gz" `
 --segchannel 2 `
 --euler_transform "(0, 0, 0)" `
 --kmeans_alignment `
 --plot
```

Euler transform is the rotation which gives the lowest prealignment score. This can be brute forced using --compute_euler_transform as an argument, but it will take awhile. Once you've computed this once, you can save the transform and reapply it next time without manually computing using --euler_transform and passing in the tuple in quotations as above.

Example Usage of Imported Package:
```
from display import Mesh

my_mesh = Mesh(meshpath="path/to/mesh.mesh")  # need meshpath= or the class will assume you are passing in raw points.
my_mesh.initialize_voltages("path/to/folder/with/xml")  # the code will attempt to find the xml voltages with the same name as your mesh.
mesh.plot()
```

As of now, the files are only available directly here. I'm currently working on getting the package available via pip.
procaaso-log 0.3.3
Logginng Utility for use within Procaaso Python Control Tasks
Requires Python: <4.0,>=3.9

# procaaso-log

Simple logging library for use with ConSynSys Procaaso ENS, etc. tasks

## Usage

1. Configure the logging backend at the root package within the `__init__.py` file.  Enable all desired module loggers.

```python
import procaaso_log
procaaso_log.standard_config("app.foo", "lib.bar.baz")
```

2. Create a logger for each python file.

```python
from procaaso_log import get_logger
logger = get_logger(__name__)
```

3. Emit logs.

```python
logger.info("something happened!")
# -> {"event":"incoming!", ...}
logger.info("incoming!", extra="single log context")
# -> {"event":"incoming!","extra"="single log context", ...}
```

4. Create a contextual logger.

```python
look_logger = logger.bind(look="over there")
look_logger.info(
# -> {"event":"incoming!","extra"="single log context"}
```