Skip to main content

Scripts for calculating the DS of modified cellulose from elemental analysis results

Project description

EADScalc

Description

EADScalc is a python script that can be used to determine the degree of substitution (DS) of modified cellulose (nanomaterials) using organic elemental analysis results, inlcuding correction for water content of the typically hygroscopic cellulose samples.

Installation

Use a python virtual environment and install via pip install EADScalc

Usage

To get help with the script, run:

EADScalc -h

The minimal amount of information you need to enter to run the calculation is:

EADScalc <carbon_content> <hydrogen_content> <nitrogen_content> --nmod <number_of_modifications> --O1 <number_O_first_mod> --H1 <number_H_first_mod>

However, the water content of the sample (humidity) and likely the sulfur content will be needed in most calculations.

For example (sulfate):

EADScalc 41 6 0 --humidity 5 --sulfur 0.5 --nmod 1 --01 4 --S1 1 --H1 1

When considering the empirical formula of the modification, consider all atoms that REPLACE the hydroxyl group that you are modifying. E.g. if you create cellulose acetate, the modification would be C2H3O2.

Output

Results are output to the terminal and to the file named in the command line as a text file.

Support

If there are issues, report via https://github.com/Sustainable-Materials-Lab/EADScalc/issues

Roadmap

No updates are planned for this project and it is in a dormant state.

Recent Updates

2025: Major code refactoring completed

  • Reduced code duplication by consolidating repetitive patterns into data-driven structures
  • Implemented decorator factories for dynamic Click option generation
  • Replaced 39+ manual option decorators with 2 reusable functions
  • Consolidated 13+ atomic mass variables into a single dictionary
  • Refactored residual calculation from 13 if-blocks to a single loop
  • Improved code maintainability while maintaining full backward compatibility
  • All command-line arguments and outputs remain identical

Contributing

Contributors are welcome.

Authors and acknowledgment

Originally authored by Samuel Eyley.

Code refactored with the help of GitHub Copilot.

License

MIT License

Project status

Dormant - I no longer use this in my day to day work, so I am not actively working on it, however, I am willing to fix problems.

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

eadscalc-1.2.5.tar.gz (8.8 kB view details)

Uploaded Source

Built Distribution

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

eadscalc-1.2.5-py3-none-any.whl (10.7 kB view details)

Uploaded Python 3

File details

Details for the file eadscalc-1.2.5.tar.gz.

File metadata

  • Download URL: eadscalc-1.2.5.tar.gz
  • Upload date:
  • Size: 8.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for eadscalc-1.2.5.tar.gz
Algorithm Hash digest
SHA256 99d8e573d8f08bcd6f8d9503aa5bfa512a83553e023ecb422b06b796a26a0e1f
MD5 f784ac5047a5e471977896a63c94c42a
BLAKE2b-256 3b132fefc492857f89dd13b4d2a7c21e6bae963e2496237fdb8616e380351a3e

See more details on using hashes here.

Provenance

The following attestation bundles were made for eadscalc-1.2.5.tar.gz:

Publisher: release.yml on Sustainable-Materials-Lab/EADScalc

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file eadscalc-1.2.5-py3-none-any.whl.

File metadata

  • Download URL: eadscalc-1.2.5-py3-none-any.whl
  • Upload date:
  • Size: 10.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for eadscalc-1.2.5-py3-none-any.whl
Algorithm Hash digest
SHA256 b04d4544383c072ea34037252c2cea1881e3ffc772a6cc7085096d3cfddbb794
MD5 38bd9dd8d03503899804e3818825487f
BLAKE2b-256 5214e6db72bf76b0b140c16bfbcfd41f0f0459f082e72f8925a6de847a11de41

See more details on using hashes here.

Provenance

The following attestation bundles were made for eadscalc-1.2.5-py3-none-any.whl:

Publisher: release.yml on Sustainable-Materials-Lab/EADScalc

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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