pymc
pymc copied to clipboard
Updated docstrings in pymc.model.core.Model
Description
First time contributor here (both to pymc and open source) - updated docstrings in pymc.model.core.Model to follow numpydoc.
There are some details that I need to call out. Some of these are notes that the instructions asked to raise (1-3), some are questions I have since I'm still unfamiliar with the codebase (4-9):
-
Should
rv_var
in these function be a TensorVariable or tensor_like?-
make_obs_var
-
create_value_var
-
register_rv
-
-
I found ndarray in the input arguments for these functions:
-
make_obs_var
-
compile_fn (in return type)
-
update_start_vals
-
initial_point
-
set_data
-
replace_rvs_by_value (in return type)
-
-
The value_var parameter is marked as a Variable - can I get a confirmation that this should not be RandomVariable?
-
There weren't any type hints in these functions. I think I can infer some of these, but I think changes like that would be out of scope for this PR.
-
__init__
-
logp_dlogp_function
-
shape_from_dims
-
set_initval
-
register_rv
-
make_obs_var (dims only)
-
add_named_variable (just var - should this be Variable?)
-
profile
-
point_logps
-
-
There originally weren't any parameters documented or type hints for these functions.
-
shape_from_dims
-
set_initval
-
-
These functions didn't have a parameters section.
-
create_value_var
-
add_named_variable
-
update_start_vals
-
-
In
register_rv
- what should the datatypes be fortransform
andinitval
? Additionally, I'm not clear on what UNSET is doing. -
In the
add_coords
function - shouldModel.add_coord
be single or double backticks? -
In
compile_fn
, what's the datatype formode
? I'm assuming its a string. Digging into pytensor it looks like the options for mode are "FAST_COMPILE", "FAST_RUN", "DebugMode", "NanGuardMode", and "DEBUG_MODE".
Related Issue
- [ ] Closes #
- [x] Related to #5459
Checklist
- [x] Checked that the pre-commit linting/style checks pass
- [x] Included tests that prove the fix is effective or that the new feature works
- [x] Added necessary documentation (docstrings and/or example notebooks)
- [ ] If you are a pro: each commit corresponds to a relevant logical change
Type of change
- [ ] New feature / enhancement
- [ ] Bug fix
- [x] Documentation
- [ ] Maintenance
- [ ] Other (please specify):
π Documentation preview π: https://pymc--7118.org.readthedocs.build/en/7118/
]
:sparkling_heart: Thanks for opening this pull request! :sparkling_heart: The PyMC community really appreciates your time and effort to contribute to the project. Please make sure you have read our Contributing Guidelines and filled in our pull request template to the best of your ability.
Great first contribution @apalermo01 - thanks!
Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:
Comparison is base (
2da4050
) 92.21% compared to head (1f8656b
) 88.61%.
Additional details and impacted files
@@ Coverage Diff @@
## main #7118 +/- ##
==========================================
- Coverage 92.21% 88.61% -3.61%
==========================================
Files 101 101
Lines 16901 16901
==========================================
- Hits 15586 14977 -609
- Misses 1315 1924 +609
Files | Coverage Ξ | |
---|---|---|
pymc/model/core.py | 91.95% <ΓΈ> (-0.26%) |
:arrow_down: |
]
Congrats on merging your first pull request! :tada: We here at PyMC are proud of you! :sparkling_heart: Thank you so much for your contribution :gift:
@apalermo01 sorry for the delay. I am merging this because the current changes are already useful. Let me know if you are still interested in tackling the other issues you mentioned and I will try and respond to them.
Thanks!