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

update customise interactions nodebook #117

Merged
merged 17 commits into from
Oct 29, 2024
Merged

Conversation

barneydobson
Copy link
Collaborator

@barneydobson barneydobson commented Oct 15, 2024

Summary

  • Update customise interactions to use extensions
  • I have added each extension in its own separate module to make them easier to understand (although mentioning these could be in the same module).
  • These modules I have reproduced in html details. My preferred option would be to use this API like in this, which feels much tidier in terms of formatting and more sustainable as code does not need to be reproduced. But as we discussed in SWMManywhere - it seems that mkdocs-jupyter can't access the API docstrings. I could use a yaml codeblock, which would include the python formatting, but it looks super weird as it is formatted differently from the notebook and can't be stored in a details. Thus, I think this is the best way, but am open to suggesstions.
  • I have done the same way to find this scripts folder as in the another demo with os - though it's a bit ugly. Obviously __file__ would be preferrable, but this doesn't seem to work with mkdocs-jupyter.
  • Bit better default behaviour for river_discharge_order.
  • a few broken hyperlinks
  • I'm going to let this close the issue update documentation for 'customise interactions' and 'river reservoir'. @barneydobson #112 - the river reservoir tutorial needs a lot of work that is not really related to extensions

Fixes #112

Copy link
Collaborator

@liuly12 liuly12 left a comment

Choose a reason for hiding this comment

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

looks good to me

Copy link
Collaborator

@dalonsoa dalonsoa left a comment

Choose a reason for hiding this comment

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

The explanations are good an clear, so all good from that part, but...

I get quite a few deprecation warning when building the documentation, as well as:

ImportError: Missing optional dependency 'tabulate'.  Use pip or conda to install tabulate.

It seems that dependency is missing. Also wrong relative links of the type;

INFO    -  Doc file 'wsimod_models.md' contains an unrecognized relative link './../reference-model/#wsimod.orchestration.model.to_datetime', it was left as is. Did you mean
           'reference-model.md#wsimod.orchestration.model.to_datetime'?

docs/demo/scripts/custom_fwtw_pull.py Outdated Show resolved Hide resolved
docs/demo/scripts/custom_reservoir_handler.py Outdated Show resolved Hide resolved
docs/demo/scripts/customise_interactions.py Show resolved Hide resolved
docs/demo/scripts/customise_interactions.py Outdated Show resolved Hide resolved
docs/demo/scripts/customise_interactions.py Outdated Show resolved Hide resolved
docs/demo/scripts/customise_interactions.py Outdated Show resolved Hide resolved
@barneydobson barneydobson requested a review from dalonsoa October 28, 2024 09:55
@barneydobson
Copy link
Collaborator Author

barneydobson commented Oct 29, 2024

@dalonsoa will update tabulate... I will check but I'm pretty sure the relative links seem to work differently in mkdocs-jupyter

@barneydobson
Copy link
Collaborator Author

barneydobson commented Oct 29, 2024

@dalonsoa yep when I serve this locally the link works. I didn't figure out why but I'm sure when I first made the documentation while the 'normal' mkdocs way of referencing (reference-model.md#wsimod.orchestration.model.to_datetime) worked locally I seem to remember it not working when deployed..

We can change every link to remove these warnings... but there's a chance it won't work when deployed and we'll have to change them back. On the live website the warned link still works

Copy link
Collaborator

@dalonsoa dalonsoa left a comment

Choose a reason for hiding this comment

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

LGTM.

I've "fix" the links in the other PR (#120) because the warnings were really annoying and, for some reason, mkdocs was failing to compile the documentation, trying again and again. We might need to undo that or fix it in another way.

@barneydobson barneydobson merged commit 5828785 into main Oct 29, 2024
20 checks passed
@barneydobson barneydobson deleted the customise-interactions branch October 29, 2024 10:12
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.

update documentation for 'customise interactions' and 'river reservoir'. @barneydobson
3 participants