Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

piecewise function #1998

Merged
merged 2 commits into from
Mar 31, 2023
Merged

piecewise function #1998

merged 2 commits into from
Mar 31, 2023

Conversation

dqnykamp
Copy link
Member

Resolves #1997

@dqnykamp dqnykamp force-pushed the piecewiseFunction branch 2 times, most recently from 08b51b2 to 3ece8a8 Compare March 27, 2023 20:06
if (dependencyValues.functionChildren.length > 0) {
return {
setValue: {
nOutputs: dependencyValues.functionChildren[0].stateValues.nOutputs
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you enforce somewhere that all of the children have the same number of outputs?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, I haven't explored what would happen if you gave it children with different numbers of inputs or even tested with more than one output. I'd say the current version is designed just for functions with one output. I would expect that bad things would happen if later functions had fewer outputs than the first and that extra output of later functions would be ignored. At some point, we should come back and make piecewiseFunction be more robust.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added #2005 to address this.

Copy link
Contributor

@jaltekruse jaltekruse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

@dqnykamp dqnykamp merged commit 8d61204 into Doenet:main Mar 31, 2023
@dqnykamp dqnykamp deleted the piecewiseFunction branch March 31, 2023 01:08
jaltekruse added a commit to jaltekruse/DoenetTools that referenced this pull request Apr 8, 2023
Squashed commit of the following:

commit c2f29cc
Merge: 9d23ae5 7cab3f6
Author: Kevin Charles <[email protected]>
Date:   Fri Apr 7 13:37:58 2023 -0500

    Merge pull request Doenet#5 from Lyanthropos/deployVite2

    update with vite-bugfix

commit 7cab3f6
Merge: cfd2ab8 9d23ae5
Author: Emilio Alvarez <[email protected]>
Date:   Fri Apr 7 13:07:17 2023 -0500

    Merge remote-tracking branch 'Kevin/deployVite2' into deployVite2

commit cfd2ab8
Merge: 7001361 33c4426
Author: Emilio Alvarez <[email protected]>
Date:   Fri Apr 7 18:06:55 2023 +0000

    Merge remote-tracking branch 'Emilio/vite-bugfix' into deployVite2

commit 33c4426
Author: Emilio Alvarez <[email protected]>
Date:   Fri Apr 7 17:25:24 2023 +0000

    increase default node space size

commit 0875f63
Author: Emilio Alvarez <[email protected]>
Date:   Fri Apr 7 17:04:13 2023 +0000

    move geogebra to public (references)

commit 6c191f8
Author: Emilio Alvarez <[email protected]>
Date:   Fri Apr 7 17:03:48 2023 +0000

    move geogebra to public (files)

commit e668f5a
Author: Emilio Alvarez <[email protected]>
Date:   Fri Apr 7 17:00:22 2023 +0000

    explicit worker module type

commit 87fc436
Author: Emilio Alvarez <[email protected]>
Date:   Fri Apr 7 00:59:05 2023 +0000

    add cache to gitnore

commit 578f693
Author: Emilio Alvarez <[email protected]>
Date:   Fri Apr 7 00:58:50 2023 +0000

    update commands

commit 825f7e5
Author: Emilio Alvarez <[email protected]>
Date:   Fri Apr 7 00:58:27 2023 +0000

    add gnome-keyring

commit 5012664
Merge: b6eabed 8c19893
Author: Emilio Alvarez <[email protected]>
Date:   Tue Apr 4 10:23:22 2023 -0500

    Merge branch 'main' into vite-bugfix

commit b6eabed
Merge: a95e754 bd04a17
Author: Emilio Alvarez <[email protected]>
Date:   Tue Apr 4 15:19:21 2023 +0000

    Merge remote-tracking branch 'Doenet/main' into vite-bugfix

commit a95e754
Author: Emilio Alvarez <[email protected]>
Date:   Tue Apr 4 15:18:55 2023 +0000

    inlcude plotly

commit bcebb93
Author: Emilio Alvarez <[email protected]>
Date:   Tue Apr 4 15:12:56 2023 +0000

    increase npm build space to 4gb

commit 8c19893
Author: Duane Nykamp <[email protected]>
Date:   Mon Apr 3 23:17:07 2023 -0500

    graph inside graph renders children inside parent graph (Doenet#2007)

commit 541f71f
Author: Duane Nykamp <[email protected]>
Date:   Mon Apr 3 23:11:54 2023 -0500

    dark mode support in core styles and test environments (Doenet#2006)

commit f5d66b1
Author: Emilio Alvarez <[email protected]>
Date:   Tue Apr 4 03:17:16 2023 +0000

    fix geogebra import

commit 8384bab
Author: Emilio Alvarez <[email protected]>
Date:   Tue Apr 4 03:15:46 2023 +0000

    switch to import flags

commit bd04a17
Author: Duane Nykamp <[email protected]>
Date:   Mon Apr 3 21:56:09 2023 -0500

    Functions inside functions are reevaluated (Doenet#2002)

    * evaluate_to_constant return NaN for non-numeric
    * Functions default to symbolic
    * Functions default to simplify
    * function simplify/expand do not affect formula

commit fc2fbc3
Author: Emilio Alvarez <[email protected]>
Date:   Tue Apr 4 02:55:51 2023 +0000

    fix image imports

commit ed43229
Author: Emilio Alvarez <[email protected]>
Date:   Mon Apr 3 21:11:42 2023 -0500

    upgrade development to vite (Doenet#2008)

commit 6fa3a61
Author: Jason Altekruse <[email protected]>
Date:   Mon Apr 3 10:35:59 2023 -0500

    Upgrade to react 18 (Doenet#1991)

    * Upgrade react 18

    - also update packages with peer dependencies on react
    - delete file not referenced anywhere (it happened to also reference
      a datetime package that has not be updated to be compatible with react
      18, but it doesn't matter because we didn't actually need it)
    - palantir/blueprint#5699

    * package lock

    * Change to use the new API for the root render call reqired in version 18

    * Remove unneeded depedency, move cypress-parallel to optional depedencies

commit 8d61204
Author: Duane Nykamp <[email protected]>
Date:   Thu Mar 30 20:08:25 2023 -0500

    piecewise function (Doenet#1998)

(cherry picked from commit 86f9660)
jaltekruse added a commit to jaltekruse/DoenetTools that referenced this pull request Jul 26, 2024
Squashed commit of the following:

commit c2f29cc
Merge: 9d23ae5 7cab3f6
Author: Kevin Charles <[email protected]>
Date:   Fri Apr 7 13:37:58 2023 -0500

    Merge pull request Doenet#5 from Lyanthropos/deployVite2

    update with vite-bugfix

commit 7cab3f6
Merge: cfd2ab8 9d23ae5
Author: Emilio Alvarez <[email protected]>
Date:   Fri Apr 7 13:07:17 2023 -0500

    Merge remote-tracking branch 'Kevin/deployVite2' into deployVite2

commit cfd2ab8
Merge: 7001361 33c4426
Author: Emilio Alvarez <[email protected]>
Date:   Fri Apr 7 18:06:55 2023 +0000

    Merge remote-tracking branch 'Emilio/vite-bugfix' into deployVite2

commit 33c4426
Author: Emilio Alvarez <[email protected]>
Date:   Fri Apr 7 17:25:24 2023 +0000

    increase default node space size

commit 0875f63
Author: Emilio Alvarez <[email protected]>
Date:   Fri Apr 7 17:04:13 2023 +0000

    move geogebra to public (references)

commit 6c191f8
Author: Emilio Alvarez <[email protected]>
Date:   Fri Apr 7 17:03:48 2023 +0000

    move geogebra to public (files)

commit e668f5a
Author: Emilio Alvarez <[email protected]>
Date:   Fri Apr 7 17:00:22 2023 +0000

    explicit worker module type

commit 87fc436
Author: Emilio Alvarez <[email protected]>
Date:   Fri Apr 7 00:59:05 2023 +0000

    add cache to gitnore

commit 578f693
Author: Emilio Alvarez <[email protected]>
Date:   Fri Apr 7 00:58:50 2023 +0000

    update commands

commit 825f7e5
Author: Emilio Alvarez <[email protected]>
Date:   Fri Apr 7 00:58:27 2023 +0000

    add gnome-keyring

commit 5012664
Merge: b6eabed 8c19893
Author: Emilio Alvarez <[email protected]>
Date:   Tue Apr 4 10:23:22 2023 -0500

    Merge branch 'main' into vite-bugfix

commit b6eabed
Merge: a95e754 bd04a17
Author: Emilio Alvarez <[email protected]>
Date:   Tue Apr 4 15:19:21 2023 +0000

    Merge remote-tracking branch 'Doenet/main' into vite-bugfix

commit a95e754
Author: Emilio Alvarez <[email protected]>
Date:   Tue Apr 4 15:18:55 2023 +0000

    inlcude plotly

commit bcebb93
Author: Emilio Alvarez <[email protected]>
Date:   Tue Apr 4 15:12:56 2023 +0000

    increase npm build space to 4gb

commit 8c19893
Author: Duane Nykamp <[email protected]>
Date:   Mon Apr 3 23:17:07 2023 -0500

    graph inside graph renders children inside parent graph (Doenet#2007)

commit 541f71f
Author: Duane Nykamp <[email protected]>
Date:   Mon Apr 3 23:11:54 2023 -0500

    dark mode support in core styles and test environments (Doenet#2006)

commit f5d66b1
Author: Emilio Alvarez <[email protected]>
Date:   Tue Apr 4 03:17:16 2023 +0000

    fix geogebra import

commit 8384bab
Author: Emilio Alvarez <[email protected]>
Date:   Tue Apr 4 03:15:46 2023 +0000

    switch to import flags

commit bd04a17
Author: Duane Nykamp <[email protected]>
Date:   Mon Apr 3 21:56:09 2023 -0500

    Functions inside functions are reevaluated (Doenet#2002)

    * evaluate_to_constant return NaN for non-numeric
    * Functions default to symbolic
    * Functions default to simplify
    * function simplify/expand do not affect formula

commit fc2fbc3
Author: Emilio Alvarez <[email protected]>
Date:   Tue Apr 4 02:55:51 2023 +0000

    fix image imports

commit ed43229
Author: Emilio Alvarez <[email protected]>
Date:   Mon Apr 3 21:11:42 2023 -0500

    upgrade development to vite (Doenet#2008)

commit 6fa3a61
Author: Jason Altekruse <[email protected]>
Date:   Mon Apr 3 10:35:59 2023 -0500

    Upgrade to react 18 (Doenet#1991)

    * Upgrade react 18

    - also update packages with peer dependencies on react
    - delete file not referenced anywhere (it happened to also reference
      a datetime package that has not be updated to be compatible with react
      18, but it doesn't matter because we didn't actually need it)
    - palantir/blueprint#5699

    * package lock

    * Change to use the new API for the root render call reqired in version 18

    * Remove unneeded depedency, move cypress-parallel to optional depedencies

commit 8d61204
Author: Duane Nykamp <[email protected]>
Date:   Thu Mar 30 20:08:25 2023 -0500

    piecewise function (Doenet#1998)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature request: piecewise defined functions
2 participants