Package: grainpy
About•Installation•Examples•Roadmap•Contributions•LicenseAboutGrainPy is a Python package for compiling, analyzing, visualizing, and interpreting grain size distribution data. The idea for GrainPy started with an abundance of grain size distribution data that wasn't being fully utilized. Initially, GrainPy was developed to quickly compare multiple grain size distribution analyses with geologic statistics and publication-quality plots. GrainPy will continue to add modern, user-friendly tools for the interpretation and presentation of sediment analyses.(back to top)InstallationIt is strongly recommended toset up a virtual environmentbefore installation, as it represents good practice and helps avoid potential dependency conflicts. In your new virtual environment (including Conda or Anaconda), you can then install the current version of GrainPy using pip...# from Mac OSX terminal (substitute "py" for "python3" on Windows)
python3 -m pip install grainpyThis should install GrainPy along with its dependency packages pandas, numpy, matplotlib, scipy, and openpyxl.ExamplesThe basic functionality of GrainPy is explained below, however, please refer to thedocumentationfor more detailed information and tutorials.Data compilationGrain size distribution data comes from a variety of methods, including sieve, hydrometer, and laser diffraction particle size analyses. GrainPy collects and organizes this data (table of bins used and percentages) for single or multiple samples, calculates cumulative percentages, and a variety of sample statistics.files = ['path(s) to grain size data files']
# create Grainsize object using path(s)
var = grainsize.GrainSizeDist(files)
var.data()
var.datacp()
var.datast()Multiple raw data tables collected from grain size measurements (left) are collected and compiled by GrainPy into usable compilation tables of the data, cumulative frequencies, and statistics (right).Grain size distribution plotsData can then be visualized and interpreted with publication-quality grain size distribution plots.# grain size distribution plots of single samples and all samples
var.gsd_single()
var.gsd_multi(stplt=False)Single samples can be plotted (left) to show histogram of binned data, cumulative percentage curve, vertical lines for mean, median, and modes. Multiple sample plots (right) show cumulative frequencies of all samples, the mean, and a 95% confidence interval.(back to top)RoadmapInitial buildPackage release, version 0.1.0Additional functionalityCompatibility with multiple data sourcesAdditional statisticsCompare multiple objectsSediment mixing modelsIntegrate with GISSee theopen issuesfor a list of features currently in development.(back to top)Contributions🔥 If you have a suggestion that you think would make this better, you can either:Create a new issuewith theenhancementlabel 🏷️...OR...Fork the Project.Create your Feature Branch.git checkout -b feature/amazingfeatureCommit your Changes.git commit -m 'Add some AmazingFeature'Push to the Branch.git push origin feature/AmazingFeatureOpen aPull request.🐛 If something isn't working,create a new issuewith the appropriate label 🏷️🌟 If you think GrainPy is pretty cool, please give it a star!🗣️ If you need to get in touch for other reasons,send me an email(back to top)LicenseCopyright 2021-2022, Matthew A. MasseyGrainPy is free software: you can redistribute it and/or modify it under the terms
of the GNU General Public License as published by the Free Software Foundation,
either version 3 of the License, or (at your option) any later version. GrainPy is
distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.(back to top)