Skip to main content

A set of commonly used tools to be used with MAFw and others

Project description

MAFW Tools

PyPI License pipeline status coverage report

A set of commonly used tools to be used with MAFw and other data analysis frameworks.

This package is often used as an incubator for tools that sooner or later will gain the stability and the required completeness to be included into MAFw.

Table of Contents

Installation

Install the package using pip:

pip install mafw-tools

Or install in development mode:

pip install -e .

Features

This package provides utility functions for:

  • File Operations: Pickle serialization/deserialization with support for compressed files
  • Plotting Tools: Flexible image plotting with customizable axes, titles, and colorbars
  • Generic Utilities: Helper functions for common operations like nested attribute retrieval

Usage

Import the package or the modules to enjoy the tools.

File tools example

from mafw_tools.file_tools import save_to_pickle, load_from_pickle

# Save multiple objects to a pickle file
data = {'key': 'value'}
save_to_pickle('data.pkl', zipped=True, my_data=data)

# Load objects from pickle file
loaded_data = load_from_pickle('data.pkl')

Plotting tools example

import matplotlib.pyplot as plt
import numpy as np
from mafw_tools.plotting_tools import plot_image

fig, ax = plt.subplots()
data = np.random.rand(10, 10)
plot_image(data, ax, title="Sample Image", attach_colorbar=True)
plt.show()

Generic tools example

from mafw_tools.generic_tools import getattr_nested

class First:
    def __init__(self, a):
        self.a = a

class Second:
    def __init__(self, b):
        self.b = First(b)

m = Second(3)
value = getattr_nested(m, 'b.a')  # Returns 3

Documentation

Full documentation is available at https://gitlab.jrc.ec.europa.eu/jrc-projects/autorad/mafw-tools

Contributing

Contributions are welcome! Please follow these steps:

  • Fork the repository
  • Create a feature branch
  • Commit your changes
  • Push to the branch
  • Create a Pull Request

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mafw_tools-1.0.0.tar.gz (264.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mafw_tools-1.0.0-py3-none-any.whl (12.2 kB view details)

Uploaded Python 3

File details

Details for the file mafw_tools-1.0.0.tar.gz.

File metadata

  • Download URL: mafw_tools-1.0.0.tar.gz
  • Upload date:
  • Size: 264.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.2

File hashes

Hashes for mafw_tools-1.0.0.tar.gz
Algorithm Hash digest
SHA256 3592380a0cdabd641f7a5a70750418d0df5d4c2ab0cb2ab7c381f271aed4a59e
MD5 52f050f6c7d957357478813fe04e3427
BLAKE2b-256 d1a1b5dcf64486f13e1f5c7d9540b8d7b7f3adc62ee48b2cff31a05d1b8908f6

See more details on using hashes here.

File details

Details for the file mafw_tools-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: mafw_tools-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 12.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.2

File hashes

Hashes for mafw_tools-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 099ceaf7325775aedb16ba1d704fafcef5ea8adce525ff1481f1157a951a068a
MD5 ca9e09f4cb34b78a7831e31deb6f6bfe
BLAKE2b-256 0c9c03d6b0b7a1b408003e8282fffdf0b570bbbccdfdc41ce08db5c5f7a38213

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page