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

Uploaded Python 3

File details

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

File metadata

  • Download URL: mafw_tools-1.0.0rc5.tar.gz
  • Upload date:
  • Size: 264.0 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.0rc5.tar.gz
Algorithm Hash digest
SHA256 082b55d5cb6547b0f53268c9605969ec137077e3670b36e53b8d16a47f99187e
MD5 b9008a11d18addff0154a397984c25d4
BLAKE2b-256 6d6da59574aea5aa04267460d200b9883ba2bf0932fd0f50cb2870537f296557

See more details on using hashes here.

File details

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

File metadata

  • Download URL: mafw_tools-1.0.0rc5-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.0rc5-py3-none-any.whl
Algorithm Hash digest
SHA256 77dabc752f01516fc34c5cf0b88a387bf46b716a02e4597f236aca8817d10c9b
MD5 05f07ce482da4732bc1bb0fcddcbfaa6
BLAKE2b-256 c64f7a1e625c279ee261a595f1cd8834b37d8753019537d224bd7a06f4033ce0

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