Skip to content

Update notebooks#148

Open
JoYvBa wants to merge 50 commits into
mainfrom
update_notebooks
Open

Update notebooks#148
JoYvBa wants to merge 50 commits into
mainfrom
update_notebooks

Conversation

@JoYvBa

@JoYvBa JoYvBa commented Mar 9, 2026

Copy link
Copy Markdown
Collaborator

Finalize mibitrans examples for documentation

Fixes #153
Fixes #147
Fixes #133

@JoYvBa JoYvBa added this to the Version 1.0 milestone Mar 9, 2026
@JoYvBa JoYvBa added this to MIBIREM Mar 9, 2026
@AlrauneZ AlrauneZ self-assigned this Mar 16, 2026
@AlrauneZ AlrauneZ linked an issue Mar 16, 2026 that may be closed by this pull request
@sonarqubecloud

Copy link
Copy Markdown

@AlrauneZ AlrauneZ added the documentation Improvements or additions to documentation label May 11, 2026
Minor changes to further documentation
@JoYvBa JoYvBa marked this pull request as ready for review May 11, 2026 08:30
@sonarqubecloud

Copy link
Copy Markdown

@AlrauneZ AlrauneZ requested review from JaroCamphuijsen and raar1 and removed request for raar1 May 11, 2026 08:39
@JoYvBa JoYvBa moved this to Review in MIBIREM May 11, 2026

@JaroCamphuijsen JaroCamphuijsen left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@JoYvBa I got untill the keesler notebook, will continue later this week, but I thought you might want to look at my comments already

Comment thread docs/background/bioscreen.md Outdated
Comment thread docs/background/bioscreen.md Outdated
Comment thread docs/background/bioscreen.md

Parameter used for transport modeling in *mibitrans* package with quantity name, mathematical symbol (used in equations), model input name and default unit. Sorted by parameter type. Quantities marked with a "*" are internally calculated and not defined by the user.

| Parameter | Symbol | *mibitrans* input | Unit |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Would it be an idea to add a column to indicate which parameters are optional and/or have a default value and what that default value is? I think that could be useful information for users.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Good point, I agree, it would be a nice clarification to have that in one place for overview. I will have to think how to design it to make it both concise and clear, since there are parameters that are conditionally optional (i.e. either v or K and i to get flow velocity, if you do not give v, K and i are not optional).

Comment thread docs/examples/animate_plume_plots.py Outdated
@@ -1129,15 +1266,22 @@
"metadata": {},
"outputs": [],
"source": [
"mb_nd = mbt_nodecay.mass_balance()\n",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Running this cell gives me the warning that the plume extends beyond the model length, while the text after the next cell, ensures us that this plume actually fits in the model domain. So we should either change the model parameters or the text in line 1293

@JoYvBa JoYvBa May 29, 2026

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

The warning was absolutely right, solved by extending the domain a little. It was a leftover from when this warn feature was specifically covered by showing that the original domain does not contain the entire plume.

"id": "9a8471a2ae8855c3",
"metadata": {},
"outputs": [],
"source": [

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Whether this type of importing works or not depends on what the current working directory is. I started my notebook inside of the examples folder which made this cell to give an error that the examples module does not exist. Removing the "examples." in each of the lines solved the issue. You could add a line at the start of this notebook to instruct users how this is assumed to be run so that they won't have to figure it out themselves. Maybe also add a comment in the this cell to give a hint about what might be wrong.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Since the BIOSCREEN_data file only contains three data objects, I would say a better solution is maybe to store and import the data in a different way. Perhaps store them as a json file and import it in the notebook by specifying the path explicitly. Then it is clear to a user, trying the example that they should change that path for their setup / jupyter session.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

When I run the file in the same place, it works fine. Which is weird, since as you point out, examples is the current directory, so importing from examples.BIOSCREEN_data should indeed fail. I am a bit unsure how an user will use this eventually. If they just download the entire examples folder there should be no problem after changing the import statement. But if they just download the individual notebook, it will be unable to locate it of course. Do you mean that the json should be located in mibitrans itself? So you could do from mbt.BIOSCREEN_data import ....? Lets discuss this perhaps next coworking day.

@JoYvBa

JoYvBa commented May 12, 2026

Copy link
Copy Markdown
Collaborator Author

@JoYvBa I got untill the keesler notebook, will continue later this week, but I thought you might want to look at my comments already

Thanks for the comments @JaroCamphuijsen! I will work on it

JoYvBa added 3 commits May 29, 2026 12:25
To prevent dependency on TkAgg, animation example now only shows saving output as .gif, not displaying inside IDE.

To prevent any import issues when working with the benchmarking_BIOSCREEN example, the bioscreen example data has been relocated to mibitrans.data.example_data, as seperate classes for BIOSCREEN and BIOSCREEN-AT data. With the respective arrays as class properties.

@JaroCamphuijsen JaroCamphuijsen left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Here are again some review comments.
I'll continue tomorrow.

"id": "a0a0aa9f-22fb-4b33-8726-eafb878eb16d",
"metadata": {},
"source": [
"Note that BIOSCREEN only provides limited resolution which causes visual differences in the results, particularly for instantaneous reaction model. Actually calculated values (indicated with markers) are identical."

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is it perhaps an idea to remove the dotted line from in between the BIOSCREEN datapoints? That perhaps makes it clear that the data is discrete instead of continuous as opposed to the output of the analytical model.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I understand what you mean, although simultaneously, I would argue that the segmented dotted lines bring attention to that despite the BIOSCREEN points corresponding with the output curve of the mibitrans model, all data, BIOSCREEN gives no information on how the solution behaves in between those points. In the bioscreen figure for instant reaction, you can see that the start and end of the curve are not very well represented by the implied straight segments of BIOSCREEN. Also, BIOSCREEN is as continuous as mibitrans models when just looking at the equations. Its just that BIOSCREEN has a fixed amount of x, y and t resolution (amount of steps) while mibitrans has no such restriction.

But I agree with the overall point, perhaps we can lower the transparency of the dotted lines a bit to bring more attention to the points for BIOSCREEN.

Comment thread docs/examples/example_keesler.ipynb Outdated
Comment thread docs/examples/example_mibitrans_anatrans.ipynb Outdated
Comment thread docs/examples/example_mibitrans_anatrans.ipynb
Comment thread docs/implementation/implemenation.md Outdated
Comment thread docs/implementation/implemenation.md Outdated

The code is structured in a modular fashion to ensure easy extension of functionality by the (future) development team as well as outside collaborators. To stimulate embedding in the scientific community, users are encouraged to report bugs and suggest extensions and issues on the GitHub issue tracker, or even self-implemented features, through pull requests.

<img src="mibitrans_schematics_structure.png" alt="Overview of `mibitrans` package structure and functionalities." width="500">

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

For me this image does not show in the local build. I would also suggest to stick to the markdown image format if you can. That said, the mkdocs asset manager is a bit of a pain. I got it working in the end by putting the image in a subdirectory of the implementation directory and using the following image link:

Suggested change
<img src="mibitrans_schematics_structure.png" alt="Overview of `mibitrans` package structure and functionalities." width="500">
![Overview of `mibitrans` package structure and functionalities.](assets/mibitrans_schematics_structure.png)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I added it to the general assets folder instead and it worked, at least when locally serving the documentation. Is that something that will not work once pushed to GitHub?

Comment thread docs/implementation/implemenation.md Outdated
Comment thread docs/implementation/mibitrans_schematics_structure.png Outdated
Comment thread docs/index.md Outdated

<img src="assets/model_comparison_trans.svg" alt="Comparison between different mibitrans" width="500">

<img src="assets/plume_animation.gif" alt="Overview of `mibitrans` package structure and functionalities." width="500">

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This image does not exist, also, maybe just include them using the markdown format. I usually really only use the html tag when I need to specify very specific things regarding the formatting. (See my suggestion in implementation.md)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
<img src="assets/plume_animation.gif" alt="Overview of `mibitrans` package structure and functionalities." width="500">
![Plume animation](assets/plume_3d_animation.gif)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Found the problem, my gitignore has *.gif (and *.png) to prevent any generated figures from escaping to GitHub. But this then applied to the docs as well. I added !docs/**, which should resolve the issue.

@JoYvBa

JoYvBa commented Jun 2, 2026

Copy link
Copy Markdown
Collaborator Author

Here are again some review comments. I'll continue tomorrow.

Thanks! Looking forward to the rest :)!

Ensured that all figures in documentation can be displayed. Changed mibitrans schematics to a .svg to preserve resolution. Changed all html figure visualization in docs to markdown format. Implementation is now correctly spelled. Animate plot plots no longer shows static plots in documentation. Automatically generated titles no longer repeat the word 'model'. Made custom titles for some of the plots in example_mibtirans_anatrans.
@sonarqubecloud

sonarqubecloud Bot commented Jun 2, 2026

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

Status: Review

Development

Successfully merging this pull request may close these issues.

Populate the landing page of the documentation Add standard visualization for source depletion Add more information to the README

3 participants