pymapdl
pymapdl copied to clipboard
feat/docs string updates
Current situation
The docs are not updated to the last 2021.2 version.
Proposal
- [ ] Setup python environment -> Package to read XML (beautiful soup?)
- [ ] Get the XML files (See Concerns 1)
- [ ] Analyze a simple command ->
SOLVE
orOUTPUT
.- [ ] Identify main tags dic (
*PARAMETERS
->docstring parameters
) - [ ] Create parser
- [ ] Create database
- [ ] Create writer
- [ ] Identify main tags dic (
- [ ] Analyze a complex/long command ->
*GET
- [ ] Adapt parser
- [ ] Adapt database
- [ ] Adapt writer
Concerns
-
Access to the XML, so far they are in a repo in TFS. Should I clone that repo? Or just the files to another repo? (keep both repos syncs) Thoughts: I think we should just copy/paste the files, or maybe implement some logic that pull the files from the repo, and check its changes.
-
Storing the processed data, I guess the best would be, either a RST file per command, or an unified database (labeling fields, close XML sort of structure). Thoughts: I feel like the best would be a file command. We can then have a way to interact with those files as methods (subclass a dict where the
__getkey__
just return the parsed corresponding XML file as a class orBeautifulSoup
object). -
We might need to do some compromises regarding the amount of information we are input. For example, images, or commands with veeery long information (i.e.
*GET
) -
Create also an MAPDL commands open website? Legal might complain?
The docs are not updated to the last 2021.2 version.
Ideally we use the xml files or whatever generated those files. Do we have a deadline for this? Also, what do we do about providing backwards compatibility as we intend this library to support at least 2 years or MAPDL releases?
Check first with only one simple command, and then reevaluate the project approach.
I suggest writing a parser for one command that generates a docstring. It should have a cli like this:
python parse_mapdl_command.py --source /path/to/mapdl/doc/source --command SOLVE --output /path/to/solve_docstring.txt
and then another routine
python substitute_docstring.py --source /path/to/pymapdl --command SOLVE --input /path/to/solve_docstring.txt
In the future we can have a function like this to at runtime change the docstring if the user installs all docs (not saying we should do this but just pointing it out as a possiblity)?
pip install ansys.mapdl.core[all_docstrings]
or
pip install ansys.mapdl.docs
and then:
from ansys.mapdl.core import launch_mapdl
mapdl = launch_mapdl(version="212")
mapdl.use_docs("212")