core

package
v0.0.0-...-85c0042 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 13, 2019 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AccuracyRatioChart

func AccuracyRatioChart(ars []AccuracyRatio, now time.Time) error

AccuracyRatioChart shows how accuracy the user has estimated, providing a feedback loop to become a better estimator.

func DeliverySchedule

func DeliverySchedule(wt worktimes.WorkTimes, now time.Time, historicalEstimateAccuracyRatios []float64, ts tasks) [100]time.Time

DeliverySchedule returns a predicted delivery schedule, as a time percentile, using the passed historical data as a basis for future work on the passed tasks.

func PadFakeHistoricalEstimateAccuracyRatios

func PadFakeHistoricalEstimateAccuracyRatios(rs, fakeRs []float64) []float64

PadFakeHistoricalEstimateAccuracyRatios returns a copy of passed historical estimate accuray ratios. If there's fewer than 20 passed ratios, they are padded with passed fake ratios. Fake ratios make 'est schedule' more useful for new estimators by providing a fake-but-conservative estimation history to supplement a growing track record of real estimates.

func PredictedDeliveryDateChart

func PredictedDeliveryDateChart(predictedDaysInFuture []float64, ts tasks, pct []string)

PredictedDeliveryDateChart renders a full-terminal chart, for predicted delivery dates of passed tasks, until user presses 'Q' to quit.

func RenderDeliverySchedule

func RenderDeliverySchedule(dates [100]time.Time) [21]string

RenderDeliverySchedule returns a list of string delivery dates for the passed delivery dates percentile.

func RenderTaskOneLineSummary

func RenderTaskOneLineSummary(t *Task, includeHeaders bool) string

RenderTaskOneLineSummary returns a string rendering of passed task suitable to be included in a one-task-per-line output to user.

func RenderYesterdayTasks

func RenderYesterdayTasks(wt worktimes.WorkTimes, ts tasks, now time.Time) string

RenderYesterdayTasks returns a user-suitable summary of task activity on first business day prior to now.

func WithEstConfigAndFile

func WithEstConfigAndFile(fn func(ec *EstConfig, ef *EstFile), failFn func())

WithEstConfigAndFile is the standard entrypoint into est/core. Loads or creates a canonical estconfig and estfile, then passes them to the passed function. TODO drop the With() and should just be (es, ef, error) TODO ensure all fatal/errors in entire app written to stderr

Types

type AccuracyRatio

type AccuracyRatio struct {
	// contains filtered or unexported fields
}

AccuracyRatio is an anonymous data point representing the accuracy of some (expected, actual) pair. The time is e.g. task done task

type AccuracyRatios

type AccuracyRatios []AccuracyRatio

AccuracyRatios provides convenience functions.

func (AccuracyRatios) After

func (ars AccuracyRatios) After(t time.Time) AccuracyRatios

After returns subset of accuracy ratios which are after the passed time.

func (AccuracyRatios) Ratios

func (ars AccuracyRatios) Ratios() []float64

Ratios returns all []AccuracyRatio.ratio.

func (AccuracyRatios) SortByTimeAscending

func (ars AccuracyRatios) SortByTimeAscending() AccuracyRatios

SortByTimeAscending sorts this []AccuracyRatio in place by ascending ar.time.

type EstConfig

type EstConfig struct {
	Estfile string // est file name
}

EstConfig is the user preferences file for est. $HOME/.estconfig is deserialized into this struct.

type EstFile

type EstFile struct {
	Version int   // future use, to migrate old estfiles
	Tasks   tasks // a type alias for []*Task
	// Fake ratios, see historicalEstimateAccuracyRatios().
	// Fake ratios are saved to EstFile so they are stable.
	FakeHistoricalEstimateAccuracyRatios []float64
	// contains filtered or unexported fields
}

EstFile is a wrapper around estFile. EstFile uses Task and provides a public API for clients, but is not serializable. estFile uses task and is serializable but unsafe for public use. Whereas Task is a wrapper around task, EstFile is a different data structure than estFile. There's a bijection between EstFile <-> estFile.

func (EstFile) HistoricalEstimateAccuracyRatios

func (ef EstFile) HistoricalEstimateAccuracyRatios() AccuracyRatios

HistoricalEstimateAccuracyRatios returns the accuracy ratios for historical tasks in this EstFile. Our definition of historical are tasks which are done and not deleted. This returned []float64 is the "evidence" in "evidence-based scheduling".

func (EstFile) Write

func (ef EstFile) Write() error

type Task

type Task struct {
	// contains filtered or unexported fields
}

Task is a wrapper around task, preventing illegal state and state transitions. Some task state can be updated only in the context of a collection of other tasks. The root cause here is that task fields must be exported to be automatically serializeable, so this wrapper tries to give us both a nice API and easy serialization.

func NewTask

func NewTask() *Task

NewTask returns a new Task.

func (*Task) Actual

func (t *Task) Actual() time.Duration

Actual returns the actual duration elapsed for this task.

func (*Task) AddActual

func (t *Task) AddActual(d time.Duration, now time.Time) error

AddActual logs actual time spent against this task. Most tasks should use auto time tracking. AddActual() provides an escape hatch for auto time tracking edge cases.

func (*Task) CreatedAt

func (t *Task) CreatedAt() time.Time

CreatedAt returns the time at which this task was created.

func (*Task) Delete

func (t *Task) Delete() error

Delete this task.

func (*Task) DeletedAt

func (t *Task) DeletedAt() time.Time

DeletedAt returns the most recent time at which this task was deleted.

func (*Task) DoneAt

func (t *Task) DoneAt() time.Time

DoneAt returns the most recent time at which this task was marked done.

func (*Task) EstimateAccuracyRatio

func (t *Task) EstimateAccuracyRatio() AccuracyRatio

EstimateAccuracyRatio returns a ratio of estimate / actual hours for a done task. I.e. 1.0 is perfect estimate, 2.0 means task was twice as fast, 0.5 task twice as long.

func (*Task) Estimated

func (t *Task) Estimated() time.Duration

Estimated returns the estimated duration for this task.

func (*Task) EstimatedAt

func (t *Task) EstimatedAt() time.Time

EstimatedAt returns the most recent time at which this task was estimated.

func (*Task) ID

func (t *Task) ID() uuid.UUID

ID returns this task's ID.

func (*Task) IsDeleted

func (t *Task) IsDeleted() bool

IsDeleted returns true iff this task is currently deleted.

func (*Task) IsDone

func (t *Task) IsDone() bool

IsDone returns true iff this task is currently done.

func (*Task) IsEstimated

func (t *Task) IsEstimated() bool

IsEstimated returns true iff this task has a non-zero estimated duration.

func (*Task) IsNeverStarted

func (t *Task) IsNeverStarted() bool

IsNeverStarted returns true iff this task was never started.

func (*Task) IsPaused

func (t *Task) IsPaused() bool

IsPaused returns true iff this task is currently paused.

func (*Task) IsStarted

func (t *Task) IsStarted() bool

IsStarted returns true iff this task is currently started.

func (*Task) Name

func (t *Task) Name() string

Name returns this task's name.

func (*Task) PausedAt

func (t *Task) PausedAt() time.Time

PausedAt returns the most recent time at which this task was paused.

func (*Task) SetEstimated

func (t *Task) SetEstimated(d time.Duration) error

SetEstimated sets this task's estimated duration.

func (*Task) SetName

func (t *Task) SetName(n string) error

SetName sets this task's name.

func (*Task) StartedAt

func (t *Task) StartedAt() time.Time

StartedAt returns the most recent time at which this task was started.

func (*Task) Undelete

func (t *Task) Undelete() error

Undelete this task.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL