semvec/pypi-packages huggingface dataset:
dpdata-ani 0.1.1
The dpdata plugin for ANI.
Requires Python: >=3.7

# dpdata_ani

The [dpdata](https://github.com/deepmodeling/dpdata) plugin for ANI.

## Features

- `ani/1x` format to load [ANI-1x dataset](https://doi.org/10.1038/s41597-020-0473-z)
- `ani/1x`, `ani/2x`, and `ani/1ccx` driver to predict using ANI models with automatic batch size
- `aiqm1` driver for [AIQM1](https://doi.org/10.1038/s41467-021-27340-2) which is based on ANI

## Installation

```sh
pip install dpdata-ani
```

To enable AIQM1,
```sh
pip install dpdata-ani[aiqm1]
```

## Usage

First, download ANI-1x dataset:
```sh
wget https://figshare.com/ndownloader/files/18112775 -O ani1x.hdf5
```

Load the ANI-1x dataset, and predict it with ANI-2x models:
```py
import dpdata
ani = dpdata.MultiSystems().from_ani_1x("ani1x.hdf5")
predict = ani.predict(driver="ani/2x")
predict.to_deepmd_hdf5("predict.hdf5")
```

The inferred data will be stored in `predict.hdf5`.
pyexc 1.0.0a0
PyExc - Python C Extension to Manage Exceptions ...

# Pyexc
Simple python exception managing written in C as python extension.

> version: 1.0.0 - alpha

> **ThreadSafe**

> License: *GNU GPLv3*

```python
try:
    # ...
except Exception as e:
    pyexc.set(e)

# ...
pyexc.raise_exc() # or pyexc.print_exc() or ...
```

## Installation
> requirements: **setuptools**

**clone** project from here and install by *setup.py* file:
```bash
python3 setup.py install
```
Or `python3 setup.py build` if you want just build it.

------
(Linux Only) Use **PIP** to install:
```bash
$ pip3 install -U pyexc
```


## API
**Pyexc** includes 7 functions:
- includes:
    - [data](#def-data---tuplebaseexception--none-any)
    - [clear](#def-clear---bool)
    - [occurred](#def-occurred---bool)
    - [set](#def-settype-baseexception--typebaseexception-args-str---block-bool-----bool)
    - [raise_exc](#def-raise_excdefault-baseexception--typebaseexception-----noreturn)
    - [print_exc](#def-print_excexception-baseexception--typebaseexception-----none)
    - [exc_info](#exc_info----tuplebaseexceptiontypebaseexceptionnone-anynone-tracebacktypenone)

#### def data() -> Tuple[BaseException | None, Any]
Returns setted exception/args as tuple.
```python
pyexc.set(TypeError, "Hi")
pyexc.data() # (<class 'TypeError'>, "Hi")
```

#### def clear() -> bool
Clears setted exception and args. \
Returns True if ok.

#### def occurred() -> bool
Returns True if an exception setted.

#### def set(type: BaseException | Type[BaseException], args: str = ..., block: bool = ...) -> bool
Set exception.

- Parameters:
    - type [`BaseException | Type[BaseException]`] Exception type.
    - args [`str`] Exception argument.
    - block [`bool`] If True and an exception setted, break and returns False. (default False)

Returns True if setted.

#### def raise_exc(default: BaseException | Type[BaseException] = ...) -> NoReturn
Raise setted exception.

- Parameters:
    - default [`BaseException | Type[BaseException]`] Default exception if not exception setted. (default SystemError)

#### def print_exc(exception: BaseException | Type[BaseException] = ...) -> None
Print exception in stderr (with traceback).

- Parameters:
    - exception [`BaseException`] an raised exception to print.

```python
pyexc.set(TypeError)
pyexc.print_exc()
# or
try:
    raise TypeError()
except Exception as e:
    pyexc.print_exc(e)
```

#### exc_info: () -> Tuple[BaseException|Type[BaseException]|None, Any|None, TracebackType|None]
Returns pack of setted exception, exception args or setted data, and exception traceback.

## Example
```python
import pyexc

def handler():
    try:
        ...
    except Exception as e:
        pyexc.set(e)

handler()
if pyexc.occurred():
    pyexc.print_exc()
    pyexc.clear()
```

### TODO
- Add callback
- Add call