Repository navigation
First-use friction: plain task durations, n_draws vs mc_samples, a fast first diagram, cost and beta-factor docs - #501
Merged
Conversation
…; lazy joint and degradation checks - A preventive or inspection task's duration may be a number, a fixed time (ExactEventTime); 0 is instant; a negative or non-finite number is refused naming the task. - The *_uncertainty methods keep n_draws (draws of parameters, each worked out without simulating) and refuse mc_samples or a removed name, naming n_draws. FaultTree refuses the removed names as the diagrams do. - A session's first diagram no longer imports surpyval's joint and degradation models to check its nodes (about 2 s, now about 0.05 s). - BetaFactor says first which basis to use; the warning past Q = 0.1 names the default basis. - The costs guide has a table of which cost is charged when; the spec says replace_cost is the replacement on failure. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L6RpnXB87vwhYETeh7ihtA
# Conflicts: # repyability/rbd/_spec.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Small fixes for traps a first-time user hits.
"duration"may be a plain number, a fixed time (surpyval'sExactEventTime); 0 is'instant'. A negative or non-finite number (or a bool or text) is refused, naming the task. Done once in_spec._duration, used by both specs.n_drawsis kept, andmc_samples=is refused naming it. The*_uncertaintymethods,uncertainty_importanceandoptimal_replacement_intervalsdraw the uncertain models' parameters and work each draw out without simulating it, son_drawscounts something different frommc_samples. They tookmc_samples=with a bare "unexpected keyword";deprecation.refuses_removed_namesnow refuses it (and the names 0.12 removed) with a message namingn_draws.FaultTreegets@refuse_removed_nameslike the diagrams. Recorded in CLAUDE.md's API conventions.surpyval.univariate.jointandsurpyval.degradation, and with them surpyval's regression code, pandas and formulaic. No model can be one of those before its module has been imported, so the check now returns early while the module is not insys.modules. The first build now takes about 0.05 s.test_first_build.pychecks, in a fresh interpreter, that building and analysing plain diagrams imports neither module.BetaFactor's basis. The docstring now opens by saying which basis to use: the default"probability"for a mission or proof-test interval,"rate"for a whole life (MTTF, simulations, Q past 0.1). The warning past Q = 0.1 names the default basis it is about.replace_costis the replacement on failure, while a planned replacement is charged its"preventive"task's"cost".Type of change
Checklist
test_refused_inputs.py(a number gives the same exact values and seeded simulations asExactEventTime, for both tasks; bad durations are refused;mc_samples/Nonsf_uncertaintyandmean_uncertaintyare refused namingn_draws),test_first_build.pytest_refused_inputs,test_first_build,test_ccf_lifetime,test_joint_node,test_degradation,test_messages,test_help,test_removed_in_0_12,test_safety_edges, and the doctests of the changed modules)CHANGELOG.mdupdated under[Unreleased]ExactEventTimemodel users already passedNotes for reviewers
The repair time (
"repairability") still refuses a plain number. That refusal is deliberate, because a number there is ambiguous between an MTTR and a fixed time, and its message already names both models.Generated by Claude Code