Skip to content

Reorganize online documentation#3382

Merged
mrmundt merged 179 commits intomainfrom
doc-reorg
Oct 30, 2024
Merged

Reorganize online documentation#3382
mrmundt merged 179 commits intomainfrom
doc-reorg

Conversation

@jsiirola
Copy link
Copy Markdown
Member

Fixes # .

Summary/Motivation:

This PR reorganizes the Pyomo online documentation to follow a Diataxis-inspired model.

Very little actual documentation changes: this PR was focused on getting the structure / layout correct and is intentionally leaving documentation updates to later (smaller) PRs. That said, there are a few significant documentation (and code) changes (itemized below).

Changes proposed in this PR:

  • Reorganize documentation around a Diataxis-inspired format
  • Enable the automatic generation of API (module, class, and function) documentation for the entire Pyomo codebase
  • Update references to BiBTeX alpha format
  • Update literalinclude:: links to be relative to the documentation root directory
  • Resolved numerous docstring formatting errors
  • Code changes
    • Improved ConfigDict numpysoc generation
    • Added flags for detecting when we are testing, building documentation, and serializing
    • Fixed (by hiding) docstring formatting errors in IntEnum
    • Resolve tempfle cleanup issues during interpreter shutdown
    • Removed use of import pyomo.{*} from __init__.py

Legal Acknowledgement

By contributing to this software project, I have read the contribution guide and agree to the following terms and conditions for my contribution:

  1. I agree my contributions are submitted under the BSD license.
  2. I represent I am authorized to make the contributions and grant the license. If my employer has rights to intellectual property that includes these contributions, I represent that I have received permission to make contributions and grant the required license on behalf of that employer.

jsiirola and others added 30 commits June 4, 2024 11:06
@blnicho blnicho self-requested a review October 15, 2024 18:51
Copy link
Copy Markdown
Contributor

@emma58 emma58 left a comment

Choose a reason for hiding this comment

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

This is really exciting! :) A few comments, but none of them should hold this up, I don't think.

Comment on lines +6 to +7
TODO: this is a copy of "Abstract vs Concrete" from Getting Started.
This should be expanded here.
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.

Did you mean to leave this TODO in?

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.

I guess my real question here is should we duplicate that documentation in two places?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yes - I did mean to leave that TODO (as it is not done yet). Ideally, one section will talk about the philosophy of why we support both Abstract and Concrete modeling paradigms, and then we can (maybe) remove abstract from Getting started

Debugging Models
================

TODO
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 worth linking to the IDAES docs for the diagnostics toolbox here, at least? Also maybe to the contrib IIS utility?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yes. We should write that documentation. I mostly tried not to write any new documentation in this PR - just reorganize things. In this case, this was a new section that we talked about needing to add several times, so it made sense to put in the placeholder as part of this PR.

Comment on lines -1 to -3
Pyomo Tutorial Examples
=======================

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.

Should this file be deleted? It's empty now, right?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This file is being deleted. The content was merged into the main doc/OnlineDocs/index.rst

@codecov
Copy link
Copy Markdown

codecov bot commented Oct 16, 2024

Codecov Report

Attention: Patch coverage is 96.19048% with 4 lines in your changes missing coverage. Please review.

Project coverage is 88.65%. Comparing base (d643e8f) to head (c9d164b).
Report is 11 commits behind head on main.

Files with missing lines Patch % Lines
pyomo/common/enums.py 82.35% 3 Missing ⚠️
pyomo/common/flags.py 96.87% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3382      +/-   ##
==========================================
+ Coverage   81.93%   88.65%   +6.71%     
==========================================
  Files         877      881       +4     
  Lines       99916    99770     -146     
==========================================
+ Hits        81866    88447    +6581     
+ Misses      18050    11323    -6727     
Flag Coverage Δ
linux 86.25% <95.23%> (?)
osx 76.19% <95.23%> (?)
other 86.75% <96.19%> (?)
win 84.60% <96.19%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Copy Markdown
Member

@blnicho blnicho left a comment

Choose a reason for hiding this comment

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

I found a few minor typos but otherwise I think this can be merged

Comment on lines +32 to +38
>>> model = pyo.ConcreteModel()
>>> model.x = pyo.Var()
>>> model.y = pyo.Var()
>>> c_list = list(model.component_objects(ctype=pyo.Var, descend_into=True))
>>> new = rename_components(model, component_list=c_list, prefix='special_')
>>> str(new)
"ComponentMap({'special_x (key=...)': 'x', 'special_y (key=...)': 'y'})"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Shouldn't this be in a doctest block?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

It's not necessary. Things that look like Python interactive sessions in the Examples are automatically picked up / tested.

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.

6 participants