claude_plugin/skills/sciris-dates/SKILL.md
Use 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.
npx skillsauth add sciris/sciris sciris-datesInstall 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 timing and date utilities. See full tutorial: docs/tutorials/tut_dates.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.
T = sc.timer()
zeros = np.zeros((n, n))
T.tt('Make zeros') # toc-then-tic (prints elapsed, resets)
rand = np.random.rand(n, n)
T.tt('Make random')
with sc.timer('My operation'):
expensive_work()
T = sc.timer()
for i in range(10):
work(i)
T.tt(f'Iteration {i}')
print(T.mean(), T.std(), T.min(), T.max())
T.plot() # Plot timing results
sc.timedsleep(0.3) # Like time.sleep()
# In a loop: accounts for computation time so each iteration = exact duration
for i in range(5):
sc.timedsleep('start')
do_work()
sc.timedsleep(0.3, verbose=True) # Total iteration = 0.3s
sc.randsleep(0.2) # Sleep random 0-0.4s (mean 0.2)
sc.time() # Unix timestamp (time.time())
sc.now() # datetime.datetime.now()
sc.getdate() # Formatted string: '2024-Mar-15 14:30:00'
sc.date('2022-03-04') # str → datetime
sc.date('04-03-2022', format='mdy') # Explicit format
sc.date('04-03-2022', format='dmy') # Day-month-year
dates = sc.daterange('2022-02-02', '2022-03-04') # List of date strings
dates = sc.daterange('2022-01-01', '2022-12-31', as_date=True) # As datetime objects
newdates = sc.datedelta(dates, months=10) # Add 10 months
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.