Skip to content

Commit

Permalink
fix: 🚨 fix linter errors
Browse files Browse the repository at this point in the history
  • Loading branch information
thkruz committed Jan 17, 2024
1 parent de5459d commit 195c5eb
Show file tree
Hide file tree
Showing 22 changed files with 55 additions and 26 deletions.
3 changes: 2 additions & 1 deletion src/force/Force.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/**
* @author @thkruz Theodore Kruczek
*
* @license AGPL-3.0-or-later
* @copyright (c) 2020-2024 Theodore Kruczek
*
Expand All @@ -25,6 +24,8 @@ export abstract class Force {
/**
* Calculate the acceleration due to the perturbing force on a given
* state vector.
* @param state The state vector.
* @throws If the force cannot be calculated.
*/
acceleration(state: J2000): Vector3D {
throw Error('Not implemented');
Expand Down
3 changes: 0 additions & 3 deletions src/force/Gravity.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/**
* @author @thkruz Theodore Kruczek
*
* @license AGPL-3.0-or-later
* @copyright (c) 2020-2024 Theodore Kruczek
*
Expand Down Expand Up @@ -34,7 +33,6 @@ export class Gravity implements Force {

/**
* Calculates the gravitational force in spherical coordinates.
*
* @param state The J2000 state containing the position and velocity vectors.
* @returns The gravitational force vector in spherical coordinates.
*/
Expand All @@ -46,7 +44,6 @@ export class Gravity implements Force {

/**
* Calculates the acceleration due to gravity at a given state.
*
* @param state The J2000 state at which to calculate the acceleration.
* @returns The acceleration vector.
*/
Expand Down
1 change: 0 additions & 1 deletion src/force/SolarRadiationPressure.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/**
* @author @thkruz Theodore Kruczek
*
* @license AGPL-3.0-or-later
* @copyright (c) 2020-2024 Theodore Kruczek
*
Expand Down
1 change: 0 additions & 1 deletion src/force/ThirdBodyGravity.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/**
* @author @thkruz Theodore Kruczek
*
* @license AGPL-3.0-or-later
* @copyright (c) 2020-2024 Theodore Kruczek
*
Expand Down
4 changes: 1 addition & 3 deletions src/interpolator/StateInterpolator.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/**
* @author @thkruz Theodore Kruczek
*
* @license AGPL-3.0-or-later
* @copyright (c) 2020-2024 Theodore Kruczek
*
Expand All @@ -26,9 +25,8 @@ import { Interpolator } from './Interpolator';
export abstract class StateInterpolator extends Interpolator {
/**
* Interpolates the state at the given epoch.
*
* @param epoch The epoch in UTC format.
* @returns The interpolated state at the given epoch, or null if interpolation is not possible.
* @throws If the interpolator has not been initialized.
*/
interpolate(epoch: EpochUTC): J2000 | null {
throw new Error('Not implemented.');
Expand Down
1 change: 0 additions & 1 deletion src/objects/DetailedSensor.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/**
* @author @thkruz Theodore Kruczek
*
* @license AGPL-3.0-or-later
* @copyright (c) 2020-2024 Theodore Kruczek
*
Expand Down
1 change: 0 additions & 1 deletion src/objects/Marker.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/**
* @author @thkruz Theodore Kruczek
*
* @license AGPL-3.0-or-later
* @copyright (c) 2020-2024 Theodore Kruczek
*
Expand Down
1 change: 0 additions & 1 deletion src/observation/ObservationUtils.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/**
* @author @thkruz Theodore Kruczek
*
* @license AGPL-3.0-or-later
* @copyright (c) 2020-2024 Theodore Kruczek
*
Expand Down
3 changes: 2 additions & 1 deletion src/observation/PropagatorPairs.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/**
* @author @thkruz Theodore Kruczek
*
* @license AGPL-3.0-or-later
* @copyright (c) 2020-2024 Theodore Kruczek
*
Expand Down Expand Up @@ -37,6 +36,8 @@ export class PropagatorPairs {

/**
* Get the step size at the provided index.
* @param index The index.
* @returns The step size.
*/
step(index: number): number {
return index < 3 ? this._posStep : this._velStep;
Expand Down
7 changes: 6 additions & 1 deletion src/operations/BoxMuller.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/**
* @author @thkruz Theodore Kruczek
*
* @license AGPL-3.0-or-later
* @copyright (c) 2020-2024 Theodore Kruczek
*
Expand Down Expand Up @@ -32,6 +31,9 @@ export class BoxMuller {
/**
* Create a new [BoxMuller] object with mean [mu], standard deviation
* [sigma], and [seed] number.
* @param mu Mean value.
* @param sigma Standard deviation.
* @param seed Random seed.
*/
constructor(mu: number, sigma: number, seed = 0) {
this.mu = mu;
Expand All @@ -54,6 +56,7 @@ export class BoxMuller {
/**
* Generate a gaussian number, with mean [mu] and standard
* deviation [sigma].
* @returns A gaussian number.
*/
nextGauss(): number {
if (this._index > 1) {
Expand All @@ -69,6 +72,8 @@ export class BoxMuller {
/**
* Generate a [Vector] of gaussian numbers, with mean [mu] and standard
* deviation [sigma].
* @param n Number of gaussian numbers to generate.
* @returns A [Vector] of gaussian numbers.
*/
gaussVector(n: number): Vector {
const result = new Float64Array(n);
Expand Down
16 changes: 15 additions & 1 deletion src/optimize/DownhillSimplex.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/**
* @author @thkruz Theodore Kruczek
*
* @license AGPL-3.0-or-later
* @copyright (c) 2020-2024 Theodore Kruczek
*
Expand All @@ -27,6 +26,9 @@ export class DownhillSimplex {
/**
* Compute the centroid from a list of [SimplexEntry] objects, using cost
* function [f].
* @param f Cost function
* @param xss Simplex entries
* @returns The centroid.
*/
private static _centroid(f: CostFunction, xss: SimplexEntry[]): SimplexEntry {
const n = xss[0].points.length;
Expand Down Expand Up @@ -58,6 +60,9 @@ export class DownhillSimplex {
/**
* Generate a new simplex from initial guess [x0], and an optional
* simplex [step] value.
* @param x0 Initial guess
* @param step Simplex step
* @returns The simplex.
*/
static generateSimplex(x0: Float64Array, step = 0.01): Float64Array[] {
const output: Float64Array[] = [x0.slice(0)];
Expand All @@ -82,6 +87,15 @@ export class DownhillSimplex {
* - `maxIter`: maximum number of optimization iterations
* - `adaptive`: use adaptive coefficients if possible
* - `printIter`: print a debug statement after each iteration
* @param f Cost function
* @param xs Initial simplex
* @param root0 Root0
* @param root0.xTolerance Root0.xTolerance
* @param root0.fTolerance Root0.fTolerance
* @param root0.maxIter Root0.maxIter
* @param root0.adaptive Root0.adaptive
* @param root0.printIter Root0.printIter
* @returns The optimal input value.
*/
static solveSimplex(
f: CostFunction,
Expand Down
19 changes: 18 additions & 1 deletion src/optimize/PolynomialRegression.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/**
* @author @thkruz Theodore Kruczek
*
* @license AGPL-3.0-or-later
* @copyright (c) 2020-2024 Theodore Kruczek
*
Expand Down Expand Up @@ -34,6 +33,12 @@ export class PolynomialRegression {
/**
* Optimize polynomial coefficients to fit data series [xs] and [ys] for the
* provided polynomial [order].
* @param xs x values
* @param ys y values
* @param order Polynomial order
* @param root0 Root0
* @param root0.printIter Root0.printIter
* @returns The optimal input value.
*/
static solve(
xs: Float64Array,
Expand All @@ -43,6 +48,11 @@ export class PolynomialRegression {
): PolynomicalRegressionResult {
const simplex = DownhillSimplex.generateSimplex(Float64Array.from(Array(order + 1).fill(1.0)));

/**
* Sum of squared errors.
* @param coeffs Polynomial coefficients
* @returns Sum of squared errors
*/
function f(coeffs: Float64Array): number {
let sse = 0.0;

Expand Down Expand Up @@ -72,6 +82,13 @@ export class PolynomialRegression {
* Optimize polynomial coefficients to fit data series [xs] and [ys], and
* attempt to find an optimal order within the [minOrder] and
* [maxOrder] bounds.
* @param xs x values
* @param ys y values
* @param minOrder Minimum polynomial order
* @param maxOrder Maximum polynomial order
* @param root0 Root0
* @param root0.printIter Root0.printIter
* @returns The optimal input value.
*/
static solveOrder(
xs: Float64Array,
Expand Down
5 changes: 4 additions & 1 deletion src/optimize/PolynomicalRegressionResult.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/**
* @author @thkruz Theodore Kruczek
*
* @license AGPL-3.0-or-later
* @copyright (c) 2020-2024 Theodore Kruczek
*
Expand All @@ -22,6 +21,10 @@ export class PolynomicalRegressionResult {
* Create a new [PolynomicalRegressionResult] object, containing the
* polynomial [coefficients], root-sum-squared error [rss], and Bayes
* information criterea [bic].
* @param coefficients The polynomial coefficients.
* @param rss The root-sum-squared error.
* @param bic The Bayes information criterea.
* @returns The optimal input value.
*/
constructor(public coefficients: Float64Array, public rss: number, public bic: number) {
// Nothing to do here.
Expand Down
5 changes: 4 additions & 1 deletion src/optimize/SimpleLinearRegression.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/**
* @author @thkruz Theodore Kruczek
*
* @license AGPL-3.0-or-later
* @copyright (c) 2020-2024 Theodore Kruczek
*
Expand All @@ -21,6 +20,8 @@ export class SimpleLinearRegression {
/**
* Create a new [SimpleLinearRegression] object from lists of x and y
* values.
* @param xs x values
* @param ys y values
*/
constructor(public xs: number[], public ys: number[]) {
this.update();
Expand Down Expand Up @@ -106,6 +107,8 @@ export class SimpleLinearRegression {
/**
* Create a new [SimpleLinearRegression] object with outliers above the
* provided standard deviation [sigma] value removed.
* @param sigma standard deviation
* @returns new [SimpleLinearRegression] object
*/
filterOutliers(sigma = 1.0): SimpleLinearRegression {
const limit = this.error * sigma;
Expand Down
1 change: 0 additions & 1 deletion src/optimize/SimplexEntry.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/**
* @author @thkruz Theodore Kruczek
*
* @license AGPL-3.0-or-later
* @copyright (c) 2020-2024 Theodore Kruczek
*
Expand Down
4 changes: 3 additions & 1 deletion src/orbit_determination/BatchLeastSquaresResult.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/**
* @author @thkruz Theodore Kruczek
*
* @license AGPL-3.0-or-later
* @copyright (c) 2020-2024 Theodore Kruczek
*
Expand All @@ -24,6 +23,9 @@ export class BatchLeastSquaresResult {
/**
* Create a new [BatchLeastSquaresResult] object, containing the solved
* [state], [covariance], and root-mean-squared error [rms].
* @param state The solved state.
* @param covariance The solved covariance.
* @param rms The root-mean-squared error.
*/
constructor(public state: J2000, public covariance: StateCovariance, public rms: number) {
// Nothing to do here.
Expand Down
1 change: 0 additions & 1 deletion src/propagator/DormandPrince54Propagator.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/**
* @author @thkruz Theodore Kruczek
*
* @license AGPL-3.0-or-later
* @copyright (c) 2020-2024 Theodore Kruczek
*
Expand Down
1 change: 0 additions & 1 deletion src/propagator/RkCheckpoint.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/**
* @author @thkruz Theodore Kruczek
*
* @license AGPL-3.0-or-later
* @copyright (c) 2020-2024 Theodore Kruczek
*
Expand Down
1 change: 0 additions & 1 deletion src/propagator/RkResult.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/**
* @author @thkruz Theodore Kruczek
*
* @license AGPL-3.0-or-later
* @copyright (c) 2020-2024 Theodore Kruczek
*
Expand Down
1 change: 0 additions & 1 deletion src/propagator/RungeKutta89Propagator.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/**
* @author @thkruz Theodore Kruczek
*
* @license AGPL-3.0-or-later
* @copyright (c) 2020-2024 Theodore Kruczek
*
Expand Down
1 change: 0 additions & 1 deletion src/propagator/Sgp4Propagator.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/**
* @author @thkruz Theodore Kruczek
*
* @license AGPL-3.0-or-later
* @copyright (c) 2020-2024 Theodore Kruczek
*
Expand Down
1 change: 0 additions & 1 deletion src/smoothing/ExponentialSmoothing.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/**
* @author @thkruz Theodore Kruczek
*
* @license AGPL-3.0-or-later
* @copyright (c) 2020-2024 Theodore Kruczek
*
Expand Down

0 comments on commit 195c5eb

Please sign in to comment.