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

Infer dtypes for all Stan interfaces #1632

Merged
merged 16 commits into from
May 16, 2021
Merged

Infer dtypes for all Stan interfaces #1632

merged 16 commits into from
May 16, 2021

Conversation

ahartikainen
Copy link
Contributor

@ahartikainen ahartikainen commented Mar 25, 2021

Description

closes #1630

Checklist

  • Follows official PR format
  • Includes a sample plot to visually illustrate the changes (only for plot-related functions)
  • New features are properly documented (with an example if appropriate)?
  • Includes new or updated tests to cover the new feature
  • Code style correct (follows pylint and black guidelines)
  • Changes are listed in changelog

Infer dtypes from model code (all interfaces) or use user given dictionary (cmdstanpy, cmdstan).

Copy link
Member

@OriolAbril OriolAbril 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, are you planning on adding tests? Maybe a test directly on infer_stan_dtypes is enough. We can always create an issue to see if it gets done

@ahartikainen
Copy link
Contributor Author

Yes. (I have not tested these yet)

@codecov
Copy link

codecov bot commented Mar 25, 2021

Codecov Report

Merging #1632 (679cd3a) into main (60988ff) will decrease coverage by 0.04%.
The diff coverage is 89.69%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1632      +/-   ##
==========================================
- Coverage   90.90%   90.86%   -0.05%     
==========================================
  Files         108      108              
  Lines       11762    11818      +56     
==========================================
+ Hits        10692    10738      +46     
- Misses       1070     1080      +10     
Impacted Files Coverage Δ
arviz/data/io_cmdstan.py 89.80% <45.45%> (-1.15%) ⬇️
arviz/data/io_cmdstanpy.py 95.43% <84.61%> (-1.07%) ⬇️
arviz/data/base.py 98.21% <100.00%> (+0.34%) ⬆️
arviz/data/io_pystan.py 96.08% <100.00%> (-0.01%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 60988ff...679cd3a. Read the comment docs.

@ahartikainen
Copy link
Contributor Author

I also added dtypes option for from_pystan, so if users have complicated stan file, they still have possibility to define correct dtypes.

Copy link
Member

@OriolAbril OriolAbril left a comment

Choose a reason for hiding this comment

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

Not sure I did a very good job with the changelog, either way, feel free to merge whenever

@ahartikainen ahartikainen merged commit 1a39374 into main May 16, 2021
@ahartikainen ahartikainen deleted the stan/dtypes branch May 16, 2021 15:05
utkarsh-maheshwari pushed a commit to utkarsh-maheshwari/arviz that referenced this pull request May 27, 2021
* reorganize stan dtypes extraction

* add dtypes option for cmdstanpy

* fix lint

* lint

* add simple tests

* add dtypes for from_pystan

* accept cmdstanpy.CmdStanModel object for dtypes

* small fixes for cmdstanpy

* dtypes test for pystan

* run isort

* fix lint

* fix lint

* fix typo

* add to changelog

* Change class loc

* fix old array handling for dtype

Co-authored-by: Oriol (ZBook) <oriol.abril.pla@gmail.com>
mjhajharia pushed a commit to mjhajharia/arviz that referenced this pull request Jun 7, 2021
* reorganize stan dtypes extraction

* add dtypes option for cmdstanpy

* fix lint

* lint

* add simple tests

* add dtypes for from_pystan

* accept cmdstanpy.CmdStanModel object for dtypes

* small fixes for cmdstanpy

* dtypes test for pystan

* run isort

* fix lint

* fix lint

* fix typo

* add to changelog

* Change class loc

* fix old array handling for dtype

Co-authored-by: Oriol (ZBook) <oriol.abril.pla@gmail.com>
mjhajharia added a commit to mjhajharia/arviz that referenced this pull request Jun 7, 2021
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.

dtypes with cmdstanpy
2 participants