From sciris
Handles dates, times, and code timing in Sciris using sc.timer, sc.tic/toc, sc.date, daterange, datedelta, sleeps, now, getdate, and format conversions.
npx claudepluginhub sciris/scirisThis skill uses the workspace's default tool permissions.
Reference for timing and date utilities. See full tutorial: `docs/tutorials/tut_dates.ipynb`.
Provides code patterns for basic Sciris features: array operations like findinds, date-formatted plotting, objdict containers, object save/load, and parallelization.
Executes Bash command to fetch current UTC date and time, ensuring accurate temporal context for time-sensitive tasks, deadlines, and documentation.
Automates Wakatime tasks via Rube MCP and Composio toolkit. Discovers tools dynamically with RUBE_SEARCH_TOOLS, manages connections, and executes operations like time queries.
Share bugs, ideas, or general feedback.
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