semvec/pypi-packages huggingface dataset:
asynccsv 1.0.2
Async CSV performance logging

# Async CSV Logger
[![PyPI](https://img.shields.io/pypi/v/asynccsv.svg)](https://pypi.python.org/pypi/asynccsv)

This module is a async csv logger that helps you log performance of your algorithm.


## Description

This module is intented to be a csv logger which will write to file async-ly.

With the hope to have minimum performance impact on benchmarking your algorithm (i.e. I/O blocking to write to disk), this is especially useful for logging performance at each iteration/time-step. Internally, it utilise threading to async write to file.

There are two way to initialise and use the logger.


## Install

```
pip install asynccsv
```


### 1. Recommended way (with block)

```python
import time
import datetime
from asynccsv import AsyncCSVLogger

with AsyncCSVLogger('path_of_your_log.csv') as logger:
    # csv titles
    logger.write(['Time', 'Accuracy', 'Num of nodes'])

    # do your other stuff
    # ......

    for i in range(10):
        # perform calculation
        # ....
        # write results to file
        logger.write([datetime.datetime.now().strftime("%S.%f"), acc, num_nodes])
        time.sleep(0.5)
```


### 2. The normal way

```python
import time
from asynccsv import AsyncCSVLogger

class MyAwesomeAlgorithm():

    def __init__(self):
        # with the 'log_timestamp' flag it will automatically log timestamp
        self.logger = AsyncCSVLogger('path_of_your_log.csv', log_timestamp=True)
        self.logger.write(['Time', 'Accuracy', 'Num of nodes'])

    def run(self):
        # perform calculation
        # ...
        logger.write([acc, num_nodes])
        time.sleep(0.5)


if __name__ == '__main__':
    awesome = MyAwesomeAlgorithm()
    for i in range(10):
        awesome.run()

    # You SHOULD run this to properly close the threading and force
    # everything to be written to disk
    # This is automatically done by the 'with' block in previous example
    awesome.logger.close()
```

---

With both methods, the final content of `path_of_your_log.csv` will look something like:

```csv
"Time","Accuracy","Num of nodes"
"57.689359","92.5","11"
"58.189979","93.5","12"
"58.690520","94.22","13"
"59.191268","93.5","15"
"59.692062","92.2","17"
"00.192850","92.4","22"
"00.693661","94.8","26"
"01.194634","96.6","27"
"01.695368","94.1","30"
"02.196014","97.5","42"

```
tom-nonsidereal-airmass 0.1.0
Tom Toolkit module to plot non-sidereal airmass
Keywords: tomtoolkit,astronomy,astrophysics,cosmology,science,fits,observatory

# Nonsidereal Target Airmass TOM Module

This module adds support to generate nonsidereal airmass plots
to the TOM Toolkit.

## Installation:

Install the module into your TOM environment:

    pip install tom-nonsidereal-airmass

In your TOM's `settings.py`, add this to `INSTALLED_APPS`:

    ...
    'tom_nonsidereal_airmass',

If you have already customized your `target_detail.html`
template you can skip ahead to "At the top of the file."

`cd` into the `templates` directory in the main directory of
your project. Make a directory called `tom_targets` and `cd` into it.

Now you need to find where pip installed the `tomtoolkit`
in the virtual environment you use for your TOM. If you don't remember
where that is, you can do

    pip show tomtoolkit

and the `Location` will tell you where it is.
Copy the following file into your `templates/tom_targets` dir:

    {tomtoolkit location}/tom_targets/templates/tom_targets/target_detail.html

At the top of the file (I put it after the first `{% load %}`),
paste the following line

    {% load nonsidereal_airmass_extras %}

Then to actually display the plots, find the line that says

    {% elif target.type == 'NON_SIDEREAL' %}

and delete the next line with the `<p>...</p>` about not being able to plot non-sidereal airmass.
Change it to

    {% nonsidereal_target_plan %}

And you're done!