Skip to main content

Small set of tools and functions for scientific code and scripts.

Project description

SciScriptTools

Small set of tools and functions for scientific code and scripts.

IO Example

An example to get started with the IO tools.

import sciscripttools as st

power = [4,5,6]
st.save_data("power_exp_01", power) # save a value, arrary, or dictionary

Load the previous saved data with

import sciscripttools as st

_, power = st.load_data("power_exp_01")

Plot Example

An example to get started with the plotting tools Note: standard_font and units of standard_figure require LaTeX!

import numpy as np
import matplotlib.pyplot as plt
import sciscripttools as st

# data
x = np.linspace(0, 2)
y = x + np.random.rand(len(x))
y2 = x + np.random.rand(len(x))

# figure

fig_params = st.figure_parameters() # generate parameters
st.standard_font(font_size = fig_params.font_size) # standarise the font

# normal matplotlib plotting
fig, axes = plt.subplots(1, 2, sharey = True) # create matplotlib figure
ax1, ax2 = axes

# plot data
ax1.plot(x, y)
ax2.plot(x, y2)
for ax in axes:
    ax.set_ylim(0, 3) 

fig.subplots_adjust(wspace = fig_params.adjust_subplot_wspace) # set subplot width spacing
sf = st.standard_figure(fig, axes, fig_params) # create standard_figure
sf.add_subplot_labels()

# add units
ylabel = "Power"; yunit = "\\watt"
sf.ylabel(ax1, ylabel, yunit)
xlabel = "Time"; xunit = "\\second"
sf.xlabel(axes, xlabel, xunit)

fig.savefig("quick_plot.png")

example quick plot

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

sciscripttools-0.2.tar.gz (24.0 kB view details)

Uploaded Source

Built Distribution

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

sciscripttools-0.2-py3-none-any.whl (38.8 kB view details)

Uploaded Python 3

File details

Details for the file sciscripttools-0.2.tar.gz.

File metadata

  • Download URL: sciscripttools-0.2.tar.gz
  • Upload date:
  • Size: 24.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.1.0 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.6.4

File hashes

Hashes for sciscripttools-0.2.tar.gz
Algorithm Hash digest
SHA256 8b873347769b4ed612a12bbe3e734635ec75051d78709f778bdfcf8bb51f45d2
MD5 3628c874966cc9b9e5df671b3f62f5a4
BLAKE2b-256 93fd3623e4d673bc2095e549cc8b0a6d42d4991ff8cb18d11e29f8809d33ef4f

See more details on using hashes here.

File details

Details for the file sciscripttools-0.2-py3-none-any.whl.

File metadata

  • Download URL: sciscripttools-0.2-py3-none-any.whl
  • Upload date:
  • Size: 38.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.1.0 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.6.4

File hashes

Hashes for sciscripttools-0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 ace3022644ca2fb8c8e098aacd867f93ea831fc8df5a8a9a3f382b4728c5bf0e
MD5 7da203691031f94d907d1c355391d08b
BLAKE2b-256 416fab1301bef4d9dfccdda586c39446ef63cfb2374bc178d296cb3c567324b4

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