semvec/pypi-packages huggingface dataset:
python-fsm-handler 0.0.3
Class to handle Finite State Machines
Requires Python: >=3.8

# Python FSM
This package contains a set of classes to handle a Finite State Machine (FSM).

# Example usage
```
from python_fsm_handler.StateHandler import FsmHandler, StateLink, StateObject
from enum import Enum


moveCounter = 0
workCounter = 0

class FsmState(Enum):
    MOVE = 0
    WORK = 1
def test():

    def movePre():
        print("move pre")

    def moveExec():
        print("move exec")
        global moveCounter
        moveCounter += 1

    def movePost():
        print("move post")
        global moveCounter
        moveCounter = 0

    def workPre():
        print("work pre")
    
    def workExec():
        print("work exec")
        global workCounter
        workCounter += 1
    
    def workPost():
        print("work post")
        global workCounter
        workCounter = 0

    def loopCallback(state):
        print(f"loopCallback: {state}")
        print(f"moveCounter: {moveCounter}")
        print(f"workCounter: {workCounter}")
    def moveToWork():
        return moveCounter >= 5
    
    def workToMove():
        return workCounter >= 5

    states = [
        StateObject(FsmState.MOVE, [
            StateLink(FsmState.WORK, moveToWork)
        ], movePre, moveExec, movePost),
        StateObject(FsmState.WORK, [
            StateLink(FsmState.MOVE, workToMove)
        ], workPre, workExec, workPost),
    ]

    fsm = FsmHandler(states, FsmState.MOVE, logger=print, loopCallback=loopCallback)
    fsm.run()

if __name__ == "__main__":
    test()
```

This code will loop an FSM infinetely back and forth between two states. Running the code you may notice that the log in the loop callback will never print counter = 5 even if the 5 is reached. This is because the execution order in the state handler is as follow:
- exec current
- check condition for transition and if it's true change state
- exec loop callback
So as you can see, the transition is happened, so the post condition reset the counter to 0 before printing in the loop callback
ParProcCo 2.1.2
Parallel Processing Coordinator. Splits dataset processing to run parallel cluster jobs and aggregates outputs
Requires Python: >=3.10

# ParProcCo

Requires a YAML configuration file in grandparent directory of package, CONDA_PREFIX/etc or /etc


```
--- !PPCConfig
allowed_programs:
    rs_map: msmapper_utils
    blah1: whatever_package1
    blah2: whatever_package2
url: https://slurm.local:8443
extra_property_envs: # optional mapping of properties to pass to Slurm's JobDescMsg
    account: MY_ACCOUNT # env var that holds account
    comment: mega job
valid_top_directories: # optional mapping of top directories accessible from cluster nodes
                       # (used to check job scripts, log and working directories)
    - /cluster_home
    - /cluster_apps
```

An entry point called `ParProcCo.allowed_programs` can be added to other packages' `setup.py`:

```
setup(
...
    entry_points={PPC_ENTRY_POINT: ['blah1 = whatever_package1']},
)
```

which will look for a module called `blah1_wrapper` in `whatever_package1` package.


## Testing

Tests can be run with
```
$ pytest tests
```
To test interactions with Slurm, set the following environment variables:
```
SLURM_REST_URL  # URL for server and port where the REST endpoints are hosted
SLURM_PARTITION # Slurm cluster parition 
SLURM_JWT       # JSON web token for access to REST endpoints
```

The environment can be set up and managed by running the `create_env` task in VSCode. This will read the token from
`~/.ssh/slurm.tkn` but will not check or generate the key. The resulting file `.vscode/.env` is used by the
`python.envFile` setting to propagate these values automatically.

On the initial run, `SLURM_REST_URL` and `SLURM_PARTITION` will need to be given values manually (unless already set as
environment variables). Those values will be kept whenever the task is rerun, with only the token being updated. As
`.vscode/.env` is ignored by git, it is safe to save these values in that file.

If you are not using VSCode, running `.vscode/create_env.sh` will create the env file, and the variables can be exported
using:
```
set -a
source ".vscode/.env"
set +a
```
proto2obj 1.0.2
Python Package made by Mhadhbi Issam .

# proto2obj

This Python library converts Protocol Buffers (Protobuf) messages into Python classes, mapping each message member to a class property. The main purpose of this library is to enable inheritance from Protobuf messages. Instead of inheriting directly from the Protobuf message (which is impossible), it inherits from a proxy class that shares the same data structure and can be converted back to Protobuf message data.

## Installation 
```bash
pip install proto2obj
```


## Example of usage  : 
### Example 1 : 
```python
from proto2obj import Proto2Obj 


# msg is a protobuff message type 

fake_msg_type = Proto2Obj(msg).convert()
#def convert(self,base = tuple() , attrs = dict()) :
#   base  = baseclasses , to generate the new type as drived from base classes 
#   attrs = extra static memebers assigned to new generated type 

# get fields  : 
print(f"Message fields : {instance.__fields__}")
# get enums 
print(f"Message enums : {instance.__enums__}")
# get nested types , they are converted also 
print(f"Message nested types : {instance.__nested_types__}")
# the original protobuff message which is converted from 
print(f"Message original  protobuff message  : {instance.__protobuf__}")

## create instance 
instance = fake_msg_type(var = value , ....)

# assigne memebers like normal python object 
instance.var = value2

# convert back to protobuff instance 
msg_instance = instance.proto()

```


### Example 2 : 
```python
from proto2obj import Proto2Obj 


# msg is a protobuff message type 

fake_msg_type = Proto2Obj(msg).convert()


class DrivedType(fake_msg_type) : 
    pass 

instance = DrivedType(var = value , ....)
```
extrap-adaptive-modeler 1.0.2
Extra-P Adaptive Modeler: Optional package for Extra-P to enable adaptive performance modeling using DNNs for model creation.
Requires Python: >=3.8

# Extra-P Adaptive Modeler

Optional package for Extra-P to enable adaptive performance modeling using DNNs for model creation.

[Read more about Extra-P under https://github.com/extra-p/extrap.](https://github.com/extra-p/extrap)
simpledft 3.0
A simple density functional theory code.
Requires Python: >=3.5

![simpledft logo](https://gitlab.com/wangenau/simpledft/-/raw/main/logo/simpledft_logo.png)

# SimpleDFT
[![Version](https://img.shields.io/pypi/v/simpledft?color=b5123e&logo=python&logoColor=ed5168&label=Version)](https://pypi.org/project/simpledft)
[![Python](https://img.shields.io/pypi/pyversions/simpledft?color=b5123e&logo=python&logoColor=ed5168&label=Python)](https://www.python.org)
[![License](https://img.shields.io/badge/license-Apache2.0-b5123e?logo=python&logoColor=ed5168&label=License)](https://gitlab.com/wangenau/simpledft/-/blob/main/LICENSE)

SimpleDFT is a simple plane wave density functional theory (DFT) code.
It is a Python implementation of the [DFT++](https://arxiv.org/abs/cond-mat/9909130) pragmas proposed by Thomas Arias et al.
Also, it serves as the minimalistic prototype for the [eminus](https://gitlab.com/wangenau/eminus) code,
which was introduced in the [master thesis](https://www.researchgate.net/publication/356537762_Domain-averaged_Fermi_holes_A_self-interaction_correction_perspective) of Wanja Timm Schulze to explain theory and software development compactly.
There is also a version written in Julia, called [SimpleDFT.jl](https://gitlab.com/wangenau/simpledft.jl).

**Note: From version 2.0 on, the implementation will slightly deviate from the master thesis to be in line with eminus.**

| SimpleDFT | Description |
| --------- | ----------- |
| Language | Python 3 |
| License | Apache 2.0 |
| Dependencies | Only NumPy |
| Basis set| Plane waves (PW) |
| DFT | Restricted Kohn-Sham (RKS) |

## Installation
The package and all necessary dependencies can be installed using pip

```terminal
pip install simpledft
```

## Examples
Example calculations, i.e., the H atom, He atom, and H2 molecule can be executed with

```terminal
python examples.py
```

## Simplifications
This code is about implementing plane wave DFT as simple as possible, while still being general.
To classify the shortcomings from a fully-fletched DFT code, the most important simplifications are listed below
* Restricted Kohn-Sham DFT only, no open-shell systems
* LDA only, no functionals using gradients
* All-electron Coulomb potential, no pseudopotentials to only treat valence electrons
* Gamma-point only, no band paths
* Steepest descent only, no sophisticated minimizations
* Random starting guess only, no calculated guess of the density

## Citation

A supplementary paper for [eminus](https://gitlab.com/wangenau/eminus) is available on [arXiv](https://arxiv.org/abs/2410.19438). The following BibTeX key can be used

```terminal
@Misc{Schulze2021,
  author    = {Schulze, Wanja T. and Schwalbe, Sebastian and Trepte, Kai and Gr{\"a}fe, Stefanie},
  title     = {eminus -- Pythonic electronic structure theory},
  year      = {2024},
  doi       = {10.48550/arXiv.2410.19438},
  publisher = {arXiv},
}
```