/sciris:sciris-advancedfrom sciris
Provides reference for advanced Sciris features: nested dict operations (makenested, getnested, setnested, iternested, search, iterobj), context blocks (capture, tryexcept), smoothinterp interpolation, ASD optimization, and animation/savemovie.
Ships in sciris. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Reference for nested dicts, context blocks, interpolation, optimization, and animation. See full tutorial: docs/tutorials/tut_advanced.ipynb.
If you need more detail, use your MCP tools (Context7 or GitMCP) to look up current Sciris documentation, or consult the other Sciris skills.
nest = {}
sc.makenested(nest, ['key1', 'key1.1']) # Create nested structure
sc.makenested(nest, ['key2', 'key2.1', 'key2.1.1'])
# Iterate over all "twigs" (leaf paths)
for twig in sc.iternested(nest):
sc.setnested(nest, twig, value) # Set value at path
val = sc.getnested(nest, twig) # Get value at path
# Search by key or value
sc.search(nest, 'key2.1.1') # Find by key pattern
sc.search(nest, value=5) # Find by value
# Transform all values
sc.iterobj(nest, transform_func, inplace=True)
sc.printjson(nest) # Pretty-print as JSON
with sc.capture() as text:
verbose_function() # All print output → text (str-like; use str(text) for a str)
lines = text.splitlines()
# Simple: exit gracefully at first exception
with sc.tryexcept():
risky_function()
# Advanced: accumulate exception history
tryexc = None
for i in range(1000):
with sc.tryexcept(history=tryexc, verbose=False) as tryexc:
fickle_function()
tryexc.disp() # Show all exceptions
# Smoother than np.interp, more conservative than scipy cubic spline
y_new = sc.smoothinterp(newx, origx, origy, smoothness=5)
result = sc.asd(objective_func, x0, verbose=False)
# Often faster and more accurate than scipy.optimize.minimize for noisy problems
frames = [plt.plot(np.cumsum(np.random.randn(100))) for i in range(20)]
sc.savemovie(frames, 'animation.gif')
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub sciris/sciris --plugin sciris10 skills in this plugin
/sciris-arraysUse when working with NumPy arrays in Sciris — finding indices, nearest values, concatenation, handling NaN/missing values, smoothing data, 2D Gaussian smoothing, or linear regression with sc.findinds, sc.findnearest, sc.cat, sc.rmnans, sc.fillnans, sc.smooth, sc.rolling, sc.linregress./sciris-datesUse when working with dates, times, or timing in Sciris — sc.timer, sc.tic, sc.toc, sc.date, sc.daterange, sc.datedelta, sc.now, sc.getdate, sc.time, sc.timedsleep, sc.randsleep, date format conversion, or timing code blocks./sciris-dictsUse when working with Sciris dictionaries or dataframes — sc.obj, sc.objdict, sc.odict, sc.dataframe, integer indexing of dicts, enumitems, object-syntax access, dataframe creation with dtypes, appendrow, or sc.dataframe.cat./sciris-filesUse when saving or loading files with Sciris — sc.save, sc.load, sc.savejson, sc.loadjson, sc.saveyaml, sc.readyaml, sc.savearchive, sc.loadarchive, sc.savefig, sc.loadmetadata, sc.getfilelist, sc.thispath, sc.makefilepath, sc.rmpath, sc.metadata, sc.compareversions, sc.require, or version/reproducibility tracking./sciris-introUse when the user needs to implement a basic Sciris features — finding array values, plotting with date formatting, sc.obj containers, saving/loading objects, or parallelization./sciris-parallelUse when parallelizing code or profiling performance with Sciris — sc.parallelize, sc.Parallel, iterarg, iterkwargs, maxcpu, maxmem, async parallelization, sc.profile, sc.benchmark, sc.memload, sc.checkram, line profiling, or CPU/memory monitoring.Other plugins' skills for the same job