semvec/pypi-packages huggingface dataset:
django-enum-simple-choices 1.0.1
Simple enum for Django choice fields
License: MIT
Requires Python: >=3.4

This app includes DjangoEnum class which compatible with Django choice fields.

Usage example::


    from django.db import models
    from django_enum import DjangoEnum


    class StatusTypes(DjangoEnum):
        ACTIVE = 0
        STOPPING = 1
        STOPPED = 2


    class MyModel(models.Model):
        status = models.IntegerField(choices=StatusTypes.choices())


CHANGELOG:

1.0.1: Fix name, value issue
gh-frames-depot 1.0.0
Package for buffering frames in memory and sharing them between processes.
License: MIT
Requires Python: >=3.10

FramesDepot Class
=================

Overview
--------

The ``FramesDepot`` class is designed to store and manage video frames
in shared memory, allowing for controlled access and efficient frame
management in asynchronous environments. It’s particularly useful in
scenarios where frames need to be shared between different processes or
handled at different rates.

Features
--------

-  **Fixed-size Queue**: Holds a specified maximum number of frames.
-  **Shared Memory**: Utilizes shared memory for efficient inter-process
   communication.
-  **Backpressure Management**: Provides a callback mechanism to handle
   situations where the frame queue is full.
-  **Asynchronous Support**: Designed to work in an asynchronous
   environment, ensuring safe and efficient operations.

Usage
-----

Initialization
~~~~~~~~~~~~~~

.. code:: python

   frame_size = (width, height, channels)  # Dimensions of the frames
   memory_name = "frame_depot"  # Name for the shared memory block
   max_size = 10  # Maximum number of frames in the queue

   frames_depot = FramesDepot(frame_size, memory_name, max_size)

Adding Frames
~~~~~~~~~~~~~

.. code:: python

   # Assume frame is a NumPy array representing a video frame and current_frame is an integer frame number
   frame_dict = {"frame_number": current_frame, "frame": frame}
   await frames_depot.enqueue(frame_dict)

Retrieving Frames
~~~~~~~~~~~~~~~~~

.. code:: python

   frame_number = 5  # The specific frame number you want to retrieve
   frames_depot.get_frame(frame_number)

Handling Full Queue
~~~~~~~~~~~~~~~~~~~

Implement a backpressure_callback function that will be called when the
queue is full.

.. code:: python

   def backpressure_callback():
       print("The queue is full. Consider slowing down frame production or handling the surplus.")

   frames_depot = FramesDepot(frame_size, memory_name, max_size, backpressure_callback)

Clearing the Queue
~~~~~~~~~~~~~~~~~~

.. code:: python

   await frames_depot.clear_queue()

Closing and Releasing Resources
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. code:: python

   await frames_depot.close()

Methods
-------

-  ``__init__(frame_size, memory_name, max_size, backpressure_callback)``:
   Initializes the FramesDepot.
-  ``enqueue(frame_dict)``: Asynchronously adds a frame to the queue and
   shared memory.
-  ``get_frame(frame_number)``: Retrieves a specific frame by number.
-  ``clear_queue()``: Asynchronously clears the frame queue and index.
-  ``close()``: Asynchronously closes and releases all resources,
   including shared memory.

Properties
----------

-  ``queue_is_full``: Indicates whether the queue is full.

Requirements
------------

-  Python 3.7+
-  NumPy
-  asyncio

Note
----

Ensure proper synchronization and error handling in your production
environment, especially when dealing with shared resources and
asynchronous operations.
astrosa 0.2
Astronomical Observation Schedule Assessment Framework
License: MIT
Requires Python: >=3.10

# AstroSA: Astronomical Observation Scheduler Assessment

This project is an assessment framework for astronomical observation schedulers.

这是一个评价天文观测调度器的框架。

## Usage

Refers to `main.py`

参见：`main.py`

## Requirements

```shell
python -m pip install -r requirements.txt
```

## Install

AstroSA is available in Pypi.

```shell
pip install astrosa
```

Also, you can install from source code.

```shell
git clone https://github/h-xie/astrosa
cd astrosa
pip install .
```

## Data

AstroSA provide a sqlite database in directory `astrosa/data/astrosa.sqlite`.It contains experimental data from the
paper, including a
priority plan, a sequential plan, and corresponding cloud data on the date 2023-06-08 at location JLO.

You can use by

```python
import sqlite3
import astrosa

database = astrosa.DATA_DIR
conn = sqlite3.connect(database + '/astrosa.sqlite')
```

### Catalogue

We also provide a data converter from `VizieR` to `sqlite` in `tyc2_to_sql.ipynb`. You can use it to convert tycho-2
from FITS format to sqlite format. Tycho-2 catalogue can be downloaded via:
[Tycho-2 catalogue in FITS](https://vizier.cds.unistra.fr/viz-bin/VizieR?-source=I/259)

### Cloud

We provide cloud image to score script `cloud_to_data.py`. You can use it to convert cloud image to cloud data. It only
counts NIGHT.

```shell
python cloud_to_data.py -f path_to_your_cloud_image
```