Skip to main content

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

Project description

MAFW Tools

PyPI License Python Version Build Status

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 .

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.0rc4.tar.gz (55.7 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.0rc4-py3-none-any.whl (12.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: mafw_tools-1.0.0rc4.tar.gz
  • Upload date:
  • Size: 55.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for mafw_tools-1.0.0rc4.tar.gz
Algorithm Hash digest
SHA256 78899cfbc14db9399b42cb33762bb77b174bb747e36424099abc6b4e66b609a1
MD5 663de57add9c830508e074ba4b3bf9c8
BLAKE2b-256 c0c8cae207c5d8740997ae120a8b05f80ecc590765896cb4c81741cd833b304f

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for mafw_tools-1.0.0rc4-py3-none-any.whl
Algorithm Hash digest
SHA256 c8b7ecd02a72cdb1f13538de5cdcb51e34085c9cd6a129e6160e0dcd5bda87c1
MD5 bab8783fdc20ea30c68a96d86bc7f753
BLAKE2b-256 51ec46a12a26a39f844c9dfb2eb58d8195a075c629ff176a46c469bcb08a26e6

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