claude_plugin/skills/sciris-advanced/SKILL.md
Use when working with advanced Sciris features — nested dictionaries (sc.makenested, sc.getnested, sc.setnested, sc.iternested, sc.search, sc.iterobj), context blocks (sc.capture, sc.tryexcept), sc.smoothinterp interpolation, sc.asd optimization, sc.animation, sc.savemovie, or sc.printjson.
npx skillsauth add sciris/sciris sciris-advancedInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
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 variable
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')
testing
Use when working with Sciris miscellaneous utilities — sc.mergedicts, sc.mergelists, sc.tolist, sc.toarray, sc.isnumber, sc.suggest, sc.download, sc.runcommand, sc.importbypath, sc.loadtext, sc.help, sc.traceback, sc.autolist, sc.pp, or type checking/conversion.
development
Use when printing or formatting output with Sciris — sc.heading, sc.printgreen, sc.printblue, colored output, sc.strjoin, sc.newlinejoin, sc.pr, sc.prettyobj, sc.indent, sc.progressbar, sc.printmedian, or monitoring loop progress.
development
Use when plotting with Sciris or Matplotlib — sc.options, sc.dateformatter, sc.commaticks, sc.SIticks, sc.boxoff, sc.setylim, sc.figlayout, sc.getrowscols, sc.vectocolor, sc.gridcolors, sc.scatter3d, sc.savefig, plot styles (sciris.simple, sciris.fancy), colormaps (parula, orangeblue), or 3D plotting.
development
Use 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.