Skip to content

Commit

Permalink
Merge pull request #80 from skieffer/rework-param-widgets
Browse files Browse the repository at this point in the history
Rework param widget fields
  • Loading branch information
skieffer authored Jun 3, 2024
2 parents e42aef5 + 041d11c commit 6ec88ca
Show file tree
Hide file tree
Showing 12 changed files with 37 additions and 45 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
In `param` widgets, `tex` field is now required, and `name` field is
no longer accepted.
2 changes: 1 addition & 1 deletion client/other-versions.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"pfsc-pdf": "3.2.0",
"pyodide": "0.21.0",
"pfsc-examp": "0.23.0",
"pfsc-examp": "0.24.0",
"pfsc-util": "0.22.8",
"displaylang": "0.23.0",
"displaylang-sympy": "0.10.4",
Expand Down
5 changes: 1 addition & 4 deletions server/pfsc/lang/widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -1590,17 +1590,14 @@ def generate_arg_spec(cls):
'ptype': {
'type': IType.STR,
},
'name': {
'tex': {
'type': IType.STR,
},
},
"OPT": {
'init': {
'type': IType.ANY,
},
'tex': {
'type': IType.STR,
},
'descrip': {
'type': IType.STR,
},
Expand Down
2 changes: 1 addition & 1 deletion server/req/test-requirements.hashless
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@
#-e ../displaylang
#-e ../sympy

git+https://github.com/proofscape/pfsc-test-modules.git@v0.30.0a2
git+https://github.com/proofscape/pfsc-test-modules.git@v0.30.0a3
2 changes: 1 addition & 1 deletion server/req/test-requirements.in
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ pytest-cov==4.0.0
# is instead delivered to the user's browser via Pyodide) we do have unit
# tests here in pfsc-server that help test code living in the pfsc-examp
# project. So for testing we do install it.
pfsc-examp==0.23.0
pfsc-examp==0.24.0
6 changes: 3 additions & 3 deletions server/req/test-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -165,9 +165,9 @@ packaging==23.1 \
# via
# -c requirements.txt
# pytest
pfsc-examp==0.23.0 \
--hash=sha256:1ab6bbfb06e24f27204ed90b3128a592dc203857161f5c3863d562c95b2342f8 \
--hash=sha256:a5cbd531f0690111c16739063aaf1b04b2c6b30c9a95cb56f4b4d7b6a6254786
pfsc-examp==0.24.0 \
--hash=sha256:3020a680a7565e66f21721c9f9024ac0c7a1dc3bb339348126c0194d3ada8be7 \
--hash=sha256:90aa09d8c1fb63f8c9fb8c83ae96488d5365081dd97732df469158bad2500830
# via -r test-requirements.in
pfsc-util==0.22.8 \
--hash=sha256:2967e36233fc05b303257d1639317e9d8db3e50f8054cc5f48b8da6dd36042a0 \
Expand Down
2 changes: 1 addition & 1 deletion server/tests/resources/repo/foo/bar/v13/expansions.pfsc
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ untrusted.

<param:eg1_k>[]{
ptype: "NumberField",
name: "k",
tex: "k",
init: "cyc(7)",
}

Expand Down
8 changes: 4 additions & 4 deletions server/tests/resources/repo/foo/eg/v0/notes.pfsc
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ Cyclic dependency between param widgets?

<param:eg1_f>[]{
ptype: "Foo",
name: "f",
tex: "f",
import: {
b: eg1_b,
},
}

<param:eg1_b>[]{
ptype: "Bar",
name: "b",
tex: "b",
import: {
f: eg1_f,
},
Expand All @@ -29,12 +29,12 @@ This time both widgets should build.

<param:eg1_f>[]{
ptype: "Prime",
name: "f",
tex: "f",
}

<param:eg1_b>[]{
ptype: "Prime",
name: "b",
tex: "b",
import: {
f: eg1_f,
},
Expand Down
44 changes: 19 additions & 25 deletions server/tests/resources/repo/foo/eg/v2/notes.pfsc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ anno Notes @@@

<param:eg1_n>[]{
ptype: "Integer",
name: "n",
tex: "n",
init: 12,
args: {
gt: 5,
Expand All @@ -11,7 +11,6 @@ anno Notes @@@

<param:eg1_d1>[]{
ptype: "Divisor",
name: "d1",
tex: "d_1",
init: 3,
import: {
Expand All @@ -21,7 +20,6 @@ anno Notes @@@

<param:eg1_d2>[]{
ptype: "Divisor",
name: "d2",
tex: "d_2",
args: {
dividing: 18,
Expand All @@ -31,7 +29,6 @@ anno Notes @@@

<param:eg1_d3>[]{
ptype: "Divisor",
name: "d3",
tex: "d_3",
import: {
n: eg1_n,
Expand All @@ -43,90 +40,89 @@ anno Notes @@@

<param:eg1_p1>[]{
ptype: "Prime",
name: "p1",
tex: "p_1",
init: 11,
}

<param:eg1_p2>[]{
ptype: "Prime",
name: "p2",
tex: "p_2",
}

<param:eg1_p3>[]{
ptype: "Prime",
name: "p3",
tex: "p_3",
args: {
odd: true,
}
}

<param:eg1_p4>[]{
ptype: "Prime",
name: "p4",
tex: "p_4",
init: 13,
args: {
chooser_upper_bound: 71,
chooserUpperBound: 71,
}
}

<param:eg1_p5>[]{
ptype: "Prime",
name: "p5",
tex: "p_5",
init: 17,
args: {
chooser_upper_bound: 163,
chooserUpperBound: 163,
}
}

<param:eg1_p6>[]{
ptype: "Prime",
name: "p6",
tex: "p_6",
init: 101,
args: {
chooser_upper_bound: 163,
chooserUpperBound: 163,
}
}

<param:eg1_p7>[]{
ptype: "Prime",
name: "p7",
tex: "p_7",
init: 23,
import: {
n: eg1_n,
},
args: {
chooser_upper_bound: "n + 100",
chooserUpperBound: "n + 100",
}
}

<param:eg1_r1>[]{
ptype: "PrimRes",
name: "r1",
tex: "r_1",
args: {
m: 49,
}
}

<param:eg1_r2>[]{
ptype: "PrimRes",
name: "r2",
tex: "r_2",
args: {
m: 343,
}
}

<param:eg1_r3>[]{
ptype: "PrimRes",
name: "r3",
tex: "r_3",
args: {
m: 2401,
}
}

<param:eg1_r4>[]{
ptype: "PrimRes",
name: "r4",
tex: "r_4",
import: {
p1: eg1_p1,
},
Expand All @@ -137,7 +133,7 @@ anno Notes @@@

<param:eg1_K1>[]{
ptype: "NumberField",
name: "K1",
tex: "K_1",
init: "cyc(7)",
args: {
gen: "zeta",
Expand All @@ -146,7 +142,7 @@ anno Notes @@@

<param:eg1_K2>[]{
ptype: "NumberField",
name: "K2",
tex: "K_2",
init: "cyclotomic_poly(7)",
args: {
gen: "zeta",
Expand All @@ -155,7 +151,7 @@ anno Notes @@@

<param:eg1_K3>[]{
ptype: "NumberField",
name: "K3",
tex: "K_3",
init: "x^2 + 5",
args: {
gen: "alpha",
Expand All @@ -165,7 +161,7 @@ anno Notes @@@

<param:eg1_K4>[]{
ptype: "NumberField",
name: "K4",
tex: "K_4",
init: "y^3 + 4*y - 7",
args: {
var: "u",
Expand All @@ -174,7 +170,6 @@ anno Notes @@@

<param:eg1_P1>[]{
ptype: "PrimeIdeal",
name: "P1",
tex: "\mathfrak{p}_1",
import: {
k: eg1_K1,
Expand All @@ -186,7 +181,6 @@ anno Notes @@@

<param:eg1_P2>[]{
ptype: "PrimeIdeal",
name: "P2",
tex: "\mathfrak{p}_2",
init: 2,
import: {
Expand Down
5 changes: 2 additions & 3 deletions server/tests/resources/repo/foo/eg/v3/notes.pfsc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ anno Notes @@@

<param:eg1_theta>[]{
ptype: "Integer",
name: "theta",
tex: "n",
init: 12,
args: {
Expand All @@ -15,7 +14,7 @@ this divisor shall divide the integer `theta`.

<param:eg1_d>[]{
ptype: "Divisor",
name: "d",
tex: "d",
init: 3,
import: {
theta: eg1_theta,
Expand All @@ -31,7 +30,7 @@ the parameter widget `theta`, and does not import it.

<param:eg1_K>[]{
ptype: "NumberField",
name: "K",
tex: "K",
init: "x^2 + 5",
args: {
gen: "theta",
Expand Down
2 changes: 1 addition & 1 deletion server/tests/resources/repo/spx/doc1/v0.1.0/foo/pageE.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Examp Widgets

.. pfsc-param:: eg1_k:
:ptype: "NumberField"
:name: "k"
:tex: "k"
:init: "cyc(7)"
:args: {
gen: "zeta",
Expand Down
2 changes: 1 addition & 1 deletion server/tests/test_sphinx.py
Original file line number Diff line number Diff line change
Expand Up @@ -618,7 +618,7 @@ def test_spx_doc1(app):
"widgets": {
"test-spx-doc1-foo-pageE-_page-eg1_k_v0-1-0": {
"ptype": "NumberField",
"name": "k",
"tex": "k",
"default": "cyc(7)",
"args": {
"gen": "zeta",
Expand Down

0 comments on commit 6ec88ca

Please sign in to comment.