semvec/pypi-packages huggingface dataset:
pyqmc 0.8.0
Real-space quantum Monte Carlo (QMC) methods for electronic structure calculations.
Requires Python: >=3.10


![Python package](https://github.com/WagnerGroup/pyqmc/workflows/Python%20package/badge.svg)
[![Documentation Status](https://readthedocs.org/projects/pyqmc/badge/?version=latest)](https://pyqmc.readthedocs.io/en/latest/?badge=latest)

## PyQMC

A python module that implements real-space quantum Monte Carlo techniques. It is primarily meant to interoperate with PySCF. Documentation is available at [readthedocs](https://pyqmc.readthedocs.io/en/latest/).
choreo-GUI 1.0.0rc0
A set of tools to compute periodic solutions to the Newtonian N-body problem
Requires Python: >=3.10
Keywords: GUI, ODE, periodic, N-body, gravitation

# choreo_GUI
This is the sister project to **choreo**, a Python package aiming at finding periodic solutions to the gravitational N-body problem. **choreo-GUI** is a Graphical User Interface (GUI) to **choreo**, facilitating the process of setting up the optimization procedure, and providing means to visualize solutions. Thanks to [Pyodide](https://pyodide.org/en/stable/), the solver can be launched directly in the browser.

## Try out this project, no installation required!

Check out the online in-browser GUI: https://gabrielfougeron.github.io/choreo/

## Power up the GUI solver with the CLI backend
Using clang or gcc as a C compiler, the single-threaded CLI solver is about 3 times faster that the wasm in-browser GUI solver. In addition, several independent single-threaded solvers can be launched simultaneously using a single command.

To use the CLI backend, follow these steps:

- Install the package
- In the GUI, define a workspace folder under `Play => Workspace => Setup Workspace`
- Every time the workspace is reloaded under `Play => Workspace => Reload Workspace` **or** every time a new initial state is generated in the GUI, a new configuration file `choreo_config.json` is written to disk.
- In the command line, run the installed script as `choreo_CLI_search -f /path/to/workspace/folder/` 

## Online documentation

Available at: https://gabrielfougeron.github.io/choreo-docs/
pycomment 0.2.0
with repr value as comment
Requires Python: >=3.10

# pycomment ![Python package](https://github.com/podhmo/pycomment/workflows/Python%20package/badge.svg) [![PyPi version](https://img.shields.io/pypi/v/pycomment.svg)](https://pypi.python.org/pypi/pycomment) [![](https://img.shields.io/badge/python-3.10+-blue.svg)](https://www.python.org/download/releases/3.10.0/) [![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://black.readthedocs.io/en/stable/)

Inserting repr value on comment with marker (marker is `# =>`). This is heavily inspired by xmpfilter of ruby's [rocodetools](https://github.com/rcodetools/rcodetools).

## install

```console
$ pip install pycomment
```

## how to use

`code.py`

```python
import sys

print("stderr", file=sys.stderr)
print("hello")
1 + 2 + 3 + 3 + 4 + 5  # =>
1 + 2 + 3 + 3 + 4 + 5  # =>
print("bye")
```

```console
$ pycomment --inplace code.py
```

```python
import sys

print("stderr", file=sys.stderr)
print("hello")
1 + 2 + 3 + 3 + 4 + 5  # => 18
1 + 2 + 3 + 3 + 4 + 5  # => 18
print("bye")


# -- stdout --------------------
# >> hello
# >> bye
```

### multi-line output

```python
import numpy as np

np.arange(9).reshape((3, 3))  # => multi-line..
# array([[0, 1, 2],
#        [3, 4, 5],
#        [6, 7, 8]])
# ..multi-line
```
sklearn-nominal 0.0.4
Extra models for scikit-learn w/ built-in support for nominal attributes
Requires Python: >=3.11

# sklearn_nominal
Extra models for scikit-learn, including Decision/Regression Trees with support for nominal values



## Installation

## Exporting to svg/png/pdf
To export tree graphs to those formats, you need `pygraphviz` (and in the future, possibly other dependencies). Regrettably, `pygraphviz` does not include its own binaries for `grpahviz`. Therefore, make sure to install `graphviz` (with headers) and `cairo`. In Ubuntu 24.04, that can be achieved with:

````
sudo apt install libgraphviz-dev graphviz cairosvg 
````


#
lop-compress 1.0.0
Compressing Tree Ensembles through Level-wise Optimization and Pruning
Requires Python: >=3.8

# TreeCompress: top-down compression of decision tree ensembles using L1 regularization

This Python software package takes a pre-trained tree ensemble model and compresses
it in a top-down fashion. Starting from the root and going down level per level, it prunes
away subtrees by fitting coefficients.

It uses the tree representation of [Veritas](https://github.com/laudv/veritas).

## Installation

From source:
```bash
git clone https://github.com/ML-KULeuven/lop_compress
cd lop_compress
pip install .
```

## Example

```python
import tree_compress
import veritas
import numpy as np
from sklearn.datasets import make_moons
from sklearn.ensemble import RandomForestClassifier

noise = 0.05
xtrain, ytrain = make_moons(200, noise=noise, random_state=1)
xtest, ytest = make_moons(200, noise=noise, random_state=2)
xvalid, yvalid = make_moons(200, noise=noise, random_state=3)

data = tree_compress.Data(xtrain, ytrain, xtest, ytest, xvalid, yvalid)

clf = RandomForestClassifier(
        max_depth=5,
        random_state=2,
        n_estimators=50)
clf.fit(data.xtrain, data.ytrain)

at_orig = veritas.get_addtree(clf, silent=silent)

compr = tree_compress.Compress(
                            data,
                            at_orig,
                            score=balanced_accuracy_score,
                            isworse=lambda v, ref: ref-v > 0.005,
                            silent=True
                        )
at_pruned = compr.compress(max_rounds=2, timeout=7200)
```

## Experiments
The code to run the experiments from our ICML paper can be run using the files in `experiment/`.

The different experiments can be run using the commands in the `experiment/settings/` folder. Figures/tables from the paper can be generated using the notebook `experiment/icml.ipynb`.

## Reference
Devos, L., Martens, T., Oruç, D.C., Meert, W., Blockeel, H., Davis, J.: Compressing tree ensembles through level-wise optimization and pruning. In: Proceedings of the 42nd International Conference on Machine Learning (2025)
xwyzsn-decorator 0.0.5
personal decorator wrapper

# Decorator 

some decorators for personal usage.

## install

```bash
pip install xwyzsn-decorator -i https://pypi.python.org/simple
```

## Usage

### timer

```python
import time 
import random 
from x_decorator.timer import timer

@timer(vvvv=True)
def idle_fn():
    time.sleep(random.randint(0,5))
    return "finish"


if __name__ == "__main__":
    idle_fn()
    print(idle_fn.total_time)

# dle_fn started at 1722061281.072323
# idle_fn ended at 1722061283.07743
# idle_fn took 2.0051069259643555 seconds
# 2.0051069259643555

```

### retry

```python

import random
from x_decorator.retry import retry

# tries: number of attempts
# exception_exclude_list: [Exceptions that you dont want to retry ]

@retry(tries=3,exception_exclude_list=[OSError],
       vvvv=True)
def fn_may_fail():
    if random.randint(0, 1) == 1:
        print("Success")
        return "Success"
    else:
        print("Fail")
        raise ValueError("Fail")
        
    
if __name__ == "__main__":
    fn_may_fail()

```

### search_with_cuda

```python
from x_decorator.search import search_with_cuda
import random
import time 
import os 


if __name__ == "__main__":
    """
    search_space: Dict[str,list], the final search space will be the product of values
    workers: int, number of conconruent process.
    call_back_fn: callable, clean up function when all process is done.
    devices: available devices, e.g., [1,1,1] means there are at most three process can run on device `1`. 
    db_path: str, where to store the sqlite3 database.
    gradio_fn: callable, how to fetch data from sqlite3. by default, 
    
    ```python
        def fetch_data():
            df = pd.DataFrame(_read(db_path))
            if len(df) == 0:
                return pd.DataFrame([])
            df.columns = ['id', 'config', 'result']
            result = pd.concat([json_normalize(df['config']), json_normalize(df['result'])], axis=1)
            return result
    ``` 

    """


    @search_with_cuda(search_space={"dim": [64, 128, 256, 512], "dim2": [512, 720]}, workers=4,
    db_path='/path/to/[xxx].db',
    call_back_fn=lambda x: print(x), devices=["1", "2"],
    gradio_fn= lambda x:x
    )
    def idle_fn(config):
        sleep = random.randint(1, 10)
        #  you can access config['dim'], config['dim2'] ,etc.
        # training 
        print(f"{os.getpid()} ENV{os.getenv('test', None)} sleep")
        time.sleep(sleep)

        #  return your eval result 
        # result need to be a dict 
        return {"pid": os.getpid(), "config": config, "sleep": sleep}
    results = idle_fn() 
    print(results)

```

### parallel_apply

```python
from x_decorator.parallel_apply import parallel_apply
import pandas as pd 
# pd.DataFrame.p_apply = parallel_apply
if __name__ == "__main__":
    # Example usage
    df = pd.DataFrame({
        'A': range(10),
        'B': range(10, 20)
    })
    def example_func(row):
        return row['A'] + row['B']
    # or df.p_apply(example_func,is_parallel=True, show_progress=True)
    result = parallel_apply(df, example_func, axis=1, is_parallel=True, show_progress=True)
    print(result)

```