semvec/pypi-packages huggingface dataset:
hobart 1.0.0b2
Obtain cross sections of polygonal meshes

# hobart

[![version](https://img.shields.io/pypi/v/hobart?style=flat-square)][pypi]
[![python versions](https://img.shields.io/pypi/pyversions/hobart?style=flat-square)][pypi]
[![license](https://img.shields.io/pypi/l/hobart?style=flat-square)][pypi]
[![coverage](https://img.shields.io/badge/coverage-100%25-brightgreen?style=flat-square)][coverage]
[![build](https://img.shields.io/circleci/project/github/lace/hobart/master?style=flat-square)][build]
[![code style](https://img.shields.io/badge/code%20style-black-black?style=flat-square)][black]

Obtain cross sections of polygonal meshes.

This library is optimized for cloud computation, however it depends on both
[NumPy][] and [the SciPy k-d tree][ckdtree]. It's designed for use with
[lacecore][].

Currently works only with triangular meshes.

Prior to version 1.0, this was a library for rendering mesh cross sections to
SVG. That library has been renamed to [hobart-svg][].

[pypi]: https://pypi.org/project/hobart/
[coverage]: https://github.com/lace/hobart/blob/master/.coveragerc#L2
[build]: https://circleci.com/gh/lace/hobart/tree/master
[docs build]: https://hobart.readthedocs.io/en/latest/
[black]: https://black.readthedocs.io/en/stable/
[trimesh]: https://trimsh.org/
[numpy]: https://numpy.org/
[ckdtree]: https://docs.scipy.org/doc/scipy/reference/generated/scipy.spatial.cKDTree.html
[lacecore]: https://github.com/lace/lacecore
[hobart-svg]: https://github.com/lace/hobart-svg

## Contribute

- Issue Tracker: https://github.com/lace/hobart/issues
- Source Code: https://github.com/lace/hobart

Pull requests welcome!


## Support

If you are having issues, please let us know.


## Acknowledgements

This library was based on code in [Lace][], which was refactored from legacy
code at Body Labs by [Alex Weiss][], with portions by [Eric Rachlin][],
[Paul Melnikow][], [Victor Alvarez][], and others. Later it was extracted
from the Body Labs codebase and open-sourced by [Guillaume Marceau][]. In
2018 it was [forked by Paul Melnikow][fork] and published as
[metabolace][fork pypi]. Thanks to a repository and package transfer from
Body Labs, the fork has been merged back into the original.

[lace]: http://github.com/lace/lace
[paul melnikow]: https://github.com/paulmelnikow
[jake beard]: https://github.com/jbeard4
[alex weiss]: https://github.com/algrs
[eric rachlin]: https://github.com/eerac
[victor alvarez]: https://github.com/yangmillstheory
[guillaume marceau]: https://github.com/gmarceau
[fork]: https://github.com/metabolize/lace
[fork pypi]: https://pypi.org/project/metabolace/

## License

The project is licensed under the two-clause BSD license.
scoping 0.1.2
Probably the best way to simulate block scopes in Python.
Requires Python: >=3.6

# Probably the best way to simulate block scopes in Python.

This is a package, as it says on the tin, to emulate block scoping in Python, 
the lack of which being a clever design choice yet sometimes a trouble.

In addition to readability and code organization 
(where your mileage may vary),
block scoping in particular helps to have variables garbage collected as soon as possible, which is useful for situations where variables may refer to expensive resources (e.g. GPU arrays).

 This package is designed to be as easy to use as possible, with the least mental burden on the user,
 whilst the implementation being necessarily confusing and cryptic due to the tricks used.

## Usage

 Other than installing from PyPI the usual way,
you can also directly download scoping.py to where your main script is to use the package.

To start a scoped block (where the variables created in the block is to be deleted after the block) use

    with scoping():
        ....

Within a block, you can selectively let a variable leak through to the outer scope (as in the traditional behavior in Python) by passing the name (as a string) to

    scoping.keep()

If you are only after using the library, 
just consider scoping and scoping.keep as 
some kind of quasi-keywords rather than real classes/objects.

See 

    from scoping import scoping
    a = 2
    with scoping():
        assert(2 == a)
        a = 3
        b = 4
        scoping.keep('b')
        assert(3 == a)
    assert(2 == a)
    assert(4 == b)

In the rare case that you would like to reserve the word "scoping" for other uses, the class can be renamed arbitrarily using the following trick:

    import scoping
    class VeryScoped(scoping.scoping): pass
    del scoping

Then the names "VeryScoped" and "VeryScoped.keep" can be used instead,
whereas the name "scoping" can be put to other uses at will.

Blocks can be nested, as well as used in functions (unlike prior art),
at the price of relying on some CPython specific feature.

## Motivation/Prior Art

See https://github.com/bskinn/tempvars with a similar idea but not the intended use for general programming, as well as a more mentally demanding interface (IMHO).

## Compatibility

Tested with python 3.6/7/8/9 under Linux
csv-file 1.0
This repository which was created to facilitate working with csv
Requires Python: >=3.6

csv_file library

Author R.A.Vidonchikov

This library provides the ability to read a csv file,
find the maximum and minimum elements in the matrix,
plot the values of the matrix elements, and also transpose the matrix to another csv file.

    def __init__(self, road, new_road):
        self.road = road
        self.results = []
        self.line = 0
        self.column = 0
        self.new_road = new_road

    def reader_csv_file(self):
        """Reads a CSV file and print it as a list of rows."""
        with open(self.road, newline='', encoding='utf-8') as file:
            inp = csv.reader(file, delimiter=';', quotechar=',', quoting=csv.QUOTE_NONE)
            for row in inp:
                self.line += 1
                self.column = 0
                for number in row:
                    self.column += 1
                    number = int(float(number))
                    self.results.append(number)

    def finder_max(self):
        maximum = np.amax(self.results)
        return maximum

    def finder_min(self):
        minimum = np.amin(self.results)
        return minimum

    def graph(self):
        x_list = list(range(0, len(self.results)))
        y1_list = list(self.results)
        fig, ax = plt.subplots(figsize=(10, 5))
        ax.set_title('Демонстрация заполения матрицы')
        ax.set_ylabel('Числа матрицы')
        plt.plot(x_list, y1_list)
        plt.ylabel("", fontsize=14, fontweight="bold")
        plt.show()

    def transpose(self):
        matrix = np.asarray(self.results).reshape(-1, self.column)
        matrix = matrix.transpose()
        with open(self.new_road, "w", newline='') as f:
            for row in matrix:
                print(' '.join(map(repr, row)), file=f)