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

Compatibility with web book and viz #4

Merged
merged 1 commit into from
Feb 21, 2024
Merged

Compatibility with web book and viz #4

merged 1 commit into from
Feb 21, 2024

Conversation

mredaelli
Copy link

The changes introduced since the fork have removed some globals from the export, so that the visualization doesn't work anymore.

Here those are restored, and the new functions that were added are scoped elsewhere, to keep things clean.

I also pinned the dependencies to versions that do not require patching.

However, one problem remains: the satisfia mdp constructor returns an object that doesn't have all the fields that a world and an mdp usually have in the webppl world.
I tried returning somerthing like _.assign({ new fields }, original_object), but when I do that computations fail (In computing V the library complains that an element of a vector is negative).

We should find out why that is, and return a proper object from VerySimpleGW. Right now I went around it by returning also the original world, so that the draw functions knows what to paint.

The changes introduced since the fork have removed some globals from the
export, so that the visualization doesn't work anymore.

Here those are restored, and the new functions that were added are
scoped elsewhere, to keep things clean.

I also pinned the dependencies to versions that do not require patching.

However, one problem remains: the satisfia mdp constructor returns an
object that doesn't have all the fields that a world and an mdp usually
have in the webppl world.
I tried returning somerthing like `_.assign({ new fields },
original_object)`, but when I do that computations fail (In computing
`V` the library complains that an element of a vector is negative).

We should find out why that is, and return a proper object from
`VerySimpleGW`. Right now I went around it by returning also the
original `world`, so that the `draw` functions knows what to paint.
@mredaelli mredaelli requested a review from mensch72 February 21, 2024 13:03
@mredaelli mredaelli self-assigned this Feb 21, 2024
@mredaelli
Copy link
Author

@v1ta111 please can you also take a look here?

My intention was to make things easy: now you clone, run npm install, and all should work: no need for a global webppl, install this, patch that. In fact, I added the pipeline to run in gitlab actions and it seems to work.

But there's always the possibility that it messes up with your setup.

@mredaelli
Copy link
Author

Oh, I forgot: is this repo supposed to show the gridworld also outside the browser somehow, with Node.js opening a OS window etc?

From the deps in the precious package.json I would think so, but the draw function explicitly bails if it's not inside a wpp editor, and I didn't see examples that do that. So I removed most dependencies.

Let me know if I missed it

@mensch72
Copy link

Oh, I forgot: is this repo supposed to show the gridworld also outside the browser somehow, with Node.js opening a OS window etc?

From the deps in the precious package.json I would think so, but the draw function explicitly bails if it's not inside a wpp editor, and I didn't see examples that do that. So I removed most dependencies.

Let me know if I missed it

i don't see a need for that right now. main purpose is really to have a light-weight playful intro to our concepts on the web.

@mensch72
Copy link

We should find out why that is, and return a proper object from VerySimpleGW. Right now I went around it by returning also the original world, so that the draw functions knows what to paint.

i'll try to devote some time on this but i agree your workaround is ok for now.

Copy link

@mensch72 mensch72 left a comment

Choose a reason for hiding this comment

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

Running npm install in my existing installation gives

npm WARN deprecated [email protected]: this library is no longer supported
npm WARN deprecated [email protected]: Use your platform's native atob() and btoa() methods instead
npm WARN deprecated [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated [email protected]: request-promise-native has been deprecated because it extends the now deprecated request package, see https://github.com/request/request/issues/3142
npm WARN deprecated [email protected]: Use your platform's native DOMException instead
npm WARN deprecated [email protected]: Use your platform's native performance.now() and performance.timeOrigin.

added 52 packages, removed 498 packages, changed 31 packages, and audited 196 packages in 25s

9 packages are looking for funding
  run `npm fund` for details

6 vulnerabilities (5 moderate, 1 critical)

which seems fine for now.

Then doing ./run.sh examples/runVerySimpleGW.wppl -- --gw GW3 --verbose also looks fine.

Will look at the code next...

Copy link

@mensch72 mensch72 left a comment

Choose a reason for hiding this comment

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

i don't see any issues, so let's merge

@mensch72 mensch72 merged commit 3f9c133 into master Feb 21, 2024
2 checks passed
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.

2 participants