Skip to content

Commit b3c1b9f

Browse files
authored
Merge pull request #66 from classmodel/new-release
Prep new release
2 parents 9567b4d + 41cc336 commit b3c1b9f

File tree

10 files changed

+56
-6
lines changed

10 files changed

+56
-6
lines changed

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,19 @@ cd packages/class
4040
pnpm json2ts
4141
```
4242

43+
### Publish package
44+
45+
To publish a new version of the class package:
46+
47+
1. Bump version in `**/package.json` and `packages/class/jsr.json` files. They should all have same version.
48+
2. Commit & push changes to main branch.
49+
3. Create a new [GitHub release](https://github.com/classmodel/class-web/releases)
50+
- Tag version and title should be the same as the version in the package.json file with `v` prefix.
51+
- Use `Implementation of the Chemistry Land-surface Atmosphere Soil Slab (CLASS) model that runs entirely in the browser.` as the description with generated release notes.
52+
4. A GitHub CI workflow will publish the package to [jsr](https://jsr.io/@classmodel/class)
53+
54+
After the workflow has completed the new version will be available on [jsr](https://jsr.io/@classmodel/class).
55+
4356
## Local build
4457

4558
To run a local development version:

apps/class-solid/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "class-solid",
33
"private": true,
4-
"version": "0.0.3",
4+
"version": "0.0.4",
55
"type": "module",
66
"scripts": {
77
"dev": "vinxi dev",

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"private": true,
3-
"version": "0.0.3",
3+
"version": "0.0.4",
44
"scripts": {
55
"build": "turbo build",
66
"dev": "turbo dev",

packages/class/jsr.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@classmodel/class",
3-
"version": "0.0.3",
3+
"version": "0.0.4",
44
"exports": {
55
".": "./src/class.ts",
66
"./class": "./src/class.ts",

packages/class/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@classmodel/class",
3-
"version": "0.0.3",
3+
"version": "0.0.4",
44
"exports": {
55
"./class": "./src/class.ts",
66
"./config": "./src/config.ts",

packages/class/src/bmi.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,22 @@
1+
/**
2+
* This module contains the Basic Modelling Interface class.
3+
* @module
4+
*/
5+
16
import { CLASS } from "./class";
27
import type { Config } from "./config";
38
import { parse } from "./validate";
49

510
/**
6-
* A lightweight [BMI](https://bmi.readthedocs.io) like interface for the CLASS model.
11+
* A lightweight [Basic Modelling Interface (BMI)](https://bmi.readthedocs.io) like interface for the CLASS model.
712
*
813
* Inspiration https://github.com/uihilab/BMI-JS/blob/main/bmijs/bmi.js
914
*
1015
* Deviations from the BMI standard
1116
* - accessors do not use dest argument
1217
* - initialize() accepts object instead of string
1318
* - parameters() returns default config
19+
* - run() as extra method
1420
*/
1521
interface BmiLight<Config> {
1622
initialize(config: Config): void;
@@ -31,6 +37,10 @@ interface BmiLight<Config> {
3137

3238
const ouput_var_names: string[] = ["h", "theta", "dtheta", "q", "dq"] as const;
3339

40+
/**
41+
* Class representing a BMI (Basic Model Interface) implementation for the CLASS model.
42+
* This class provides methods to initialize, update, and retrieve information from the model.
43+
*/
3444
export class BmiClass implements BmiLight<Config> {
3545
config: Config = parse({});
3646
model: CLASS = new CLASS(this.config);

packages/class/src/class.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
/**
2+
* This module contains the CLASS model implementation.
3+
* @module
4+
*/
15
import type { Config } from "./config";
26

37
// Constants
@@ -14,7 +18,6 @@ const cp = 1005.0; /** Specific heat of dry air [J kg-1 K-1] */
1418
* @property dq: Specific humidity jump at h [kg kg-1]
1519
* @property t: Model time [s]
1620
*/
17-
1821
export class CLASS {
1922
_cfg: Config;
2023
h: number;

packages/class/src/runclass.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
/**
2+
* Script to run Class model with default configuration.
3+
*
4+
* @module
5+
*/
16
import { CLASS } from "./class";
27
import type { ClassOutput } from "./runner";
38
import { parse } from "./validate";

packages/class/src/runner.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
/**
2+
* This module contains the `runClass` function
3+
*
4+
* @module
5+
*/
16
import { CLASS } from "./class";
27
import type { Config } from "./config";
38
import { parse } from "./validate";

packages/class/src/validate.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
/**
2+
* This module contains functions to validate and parse configuration objects.
3+
*
4+
* @module
5+
*/
16
import Ajv from "ajv/dist/2019";
27
import type { DefinedError, JSONSchemaType } from "ajv/dist/2019";
38

@@ -155,6 +160,9 @@ export function overwriteDefaultsInJsonSchema<C>(
155160
return newSchema;
156161
}
157162

163+
/**
164+
* An experiment configuration is a combination of a reference configuration and a set of permutation configurations.
165+
*/
158166
export interface ExperimentConfigSchema {
159167
name: string;
160168
description?: string;
@@ -189,6 +197,12 @@ const jsonSchemaOfExperimentConfig = {
189197

190198
const validateExperimentConfig = ajv.compile(jsonSchemaOfExperimentConfig);
191199

200+
/** Parse unknown input into a Experiment configuration
201+
*
202+
* @param input - The input to be parsed.
203+
* @returns The validated input as a Experiment configuration object.
204+
* @throws {ValidationError} If the input is not valid according to the validation rules.
205+
*/
192206
export function parseExperimentConfig(input: unknown): ExperimentConfigSchema {
193207
if (!validateExperimentConfig(input)) {
194208
throw new ValidationError(

0 commit comments

Comments
 (0)