Skip to main content

MassComposition

Run Tests Publish Docs

MassComposition is a python package that allows Geoscientists and Metallurgists to easily work with, and visualise mass-compositional data.

Mass Composition in this context is just that - Mass and Composition. It is not Compositional Data Analysis (CoDA), since here we care more about mathematical operations like weight averaging and technically correct mathematical operations. Of course, we also need to manage moisture correctly - chemical composition is reported on a dry basis and moisture on a wet basis.

The package not only supports individual MassComposition, but collections of objects that are mathematically related in a Directional Graph (a.k.a. network or flowsheet).

example plot

Prerequisites

Before you begin, ensure you have met the following requirements:

  • You have installed the latest version of the mass-composition python package.
  • You have a Windows/Linux/Mac machine.
  • You have read the docs.

Installing MassComposition

To install MassComposition, follow these steps:

pip install mass-composition -e .[viz,network]

Or, if poetry is more your flavour.

poetry add "mass-composition[viz,network]"

Using MassComposition

To use MassComposition, follow these steps:

There are some basic requirements that the incoming DataFrame must meet. We'll use a sample DataFrame here.

df_data: pd.DataFrame = sample_data()

Create the object

obj_mc: MassComposition = MassComposition(df_data)

It is then trivial to calculate the weight average aggregate of the dataset.

obj_mc.aggregate()

Multiple composition analytes can be viewed in a single interactive parallel coordinates plot.

obj_mc: MassComposition = MassComposition(df_data.reset_index().set_index(['DHID', 'interval_from', 'interval_to']),
                                          name=name)

fig: Figure = obj_mc.plot_parallel(color='Fe')
fig

Network visualisations and other plots are interactive.

For full examples, see the gallery.

Contributing to MassComposition

To contribute to MassComposition, follow these steps:

  1. Fork this repository.
  2. Create a branch: git checkout -b <branch_name>.
  3. Make your changes and commit them: git commit -m '<commit_message>'
  4. Push to the original branch: git push origin mass-composition
  5. Create the pull request.

Alternatively see the GitHub documentation on creating a pull request.

Contributors

This project is still in its infancy, but I'm keen to work with contributors.

Contact

If you want to contact me you can reach me at your_email@address.com.

License

This project uses the following license: MIT.

Download files

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

Source Distribution

mass_composition-0.6.0.tar.gz (62.0 kB view details)

Uploaded Source

Built Distribution

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

mass_composition-0.6.0-py3-none-any.whl (69.0 kB view details)

Uploaded Python 3

File details

Details for the file mass_composition-0.6.0.tar.gz.

File metadata

  • Download URL: mass_composition-0.6.0.tar.gz
  • Upload date:
  • Size: 62.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.9.19

File hashes

Hashes for mass_composition-0.6.0.tar.gz
Algorithm Hash digest
SHA256 8e969ac513c367915de553c50b433e9c789bfa869dd951556e2de282df5d0902
MD5 0b4263294f0a96826b44bb0aa04e7c55
BLAKE2b-256 1a97c81d35abb5808ddba5bd048542dd4a97f7ab63286f75e8f772fadbedca10

See more details on using hashes here.

File details

Details for the file mass_composition-0.6.0-py3-none-any.whl.

File metadata

File hashes

Hashes for mass_composition-0.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fa4c575094cf6c88c684485e845e37a80541a3e120d284f3ac93276884001d35
MD5 f5c0b6eab20d0d4c2bc0caacab010f6a
BLAKE2b-256 0605cfa746cb2e217b6a04d372aa92c1b93bcbe500fca5007f9b404db9294072

See more details on using hashes here.

Release history Release notifications | RSS feed

0.6.8

2 files

0.6.7

2 files

0.6.6

2 files

0.6.5

2 files

0.6.4

2 files

0.6.3

2 files

0.6.2

2 files

0.6.1

2 files

This release

0.6.0 This release

2 files

0.5.2

2 files

0.5.1

2 files

0.5.0

2 files

0.4.12

2 files

0.4.11

2 files

0.4.10

2 files

0.4.9

2 files

0.4.8

2 files

0.4.7

2 files

0.4.6

2 files

0.4.3

2 files

0.3.12

2 files

0.3.11

2 files

0.3.10

2 files

0.3.9

2 files

0.3.8

2 files

0.3.7

2 files

0.3.6

2 files

0.3.5

2 files

0.3.4

2 files

0.3.2

2 files

0.3.1

2 files

0.3.0

2 files

0.2.1

2 files

0.2.0

2 files

0.1.28

2 files

0.1.27

2 files

0.1.26

2 files

0.1.24

2 files

0.1.23

2 files

0.1.22

2 files

0.1.20

2 files

0.1.19

2 files

0.1.18

2 files

0.1.17

2 files

0.1.16

2 files

0.1.15

2 files

0.1.14

2 files

0.1.12

2 files

0.1.11

2 files

0.1.10

2 files

0.1.9

2 files

0.1.8

2 files

0.1.7

2 files

0.1.6

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page