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

177: use num_elements instead of size #178

Merged
merged 2 commits into from
Dec 11, 2024
Merged

Conversation

sbfnk
Copy link
Contributor

@sbfnk sbfnk commented Dec 10, 2024

Description

This PR closes #177 by replacing size with num_elements.

Checklist

  • My PR is based on a package issue and I have explicitly linked it.
  • I have included the target issue or issues in the PR title in the for Issue(s) issue-numbers: PR title
  • I have read the contribution guidelines.
  • I have tested my changes locally.
  • I have added or updated unit tests where necessary.
  • I have updated the documentation if required.
  • My code follows the established coding standards.
  • I have added a news item linked to this PR.
  • I have reviewed CI checks for this PR and addressed them as far as I am able.

Copy link
Contributor

@seabbs seabbs left a comment

Choose a reason for hiding this comment

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

As noted in the issue I am quite unclear why this didn't work for you in the first place given it works on CI and in epidist. @athowes did you have some m3 issues and did it look the same? Any comment on this

As this is causing issues regardless of why I am happy to change but can you first update the news file and add yourself as a contributor in the description

@athowes
Copy link
Contributor

athowes commented Dec 11, 2024

Here is the error I had: epinowcast/epidist#221 (comment).

It was to do with stan::math::size so I think it might be the same but unsure.

@sbfnk
Copy link
Contributor Author

sbfnk commented Dec 11, 2024

Yes, I think that was the same error - the issue being the failing implicit conversion from size_t to int, see also stan-dev/math#3085

size_t is platform specific so I think this might explain why it fails only on some systems

@seabbs
Copy link
Contributor

seabbs commented Dec 11, 2024

I think there isn't a point to forcing people to use a different compiler flag if this is all Mn MacBooks which it sounds like it is so this change to the code makes sense if it works for both of you (and as it works everywhere the old version worked).

@sbfnk
Copy link
Contributor Author

sbfnk commented Dec 11, 2024

@seabbs
Copy link
Contributor

seabbs commented Dec 11, 2024

My preference would be to keep using size as its shorter and so makes the code easier to parse but its a weak preference. Perhaps we merge this and I will make a issue to revert once the things flows out and is confirmed

@sbfnk
Copy link
Contributor Author

sbfnk commented Dec 11, 2024

add yourself as a contributor in the description

turns out I'm there already

@seabbs
Copy link
Contributor

seabbs commented Dec 11, 2024

😱

@seabbs seabbs enabled auto-merge (squash) December 11, 2024 10:31
Copy link
Contributor

@seabbs seabbs left a comment

Choose a reason for hiding this comment

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

LGTM

@sbfnk
Copy link
Contributor Author

sbfnk commented Dec 11, 2024

I still get (almost) the same error with the latest stan math library -- size_t has been replaced by int64_t but conversion to int still yields a warning.

@seabbs seabbs merged commit 2cfa802 into epinowcast:main Dec 11, 2024
12 checks passed
@sbfnk sbfnk deleted the fix-size branch December 11, 2024 10:44
sbfnk added a commit to sbfnk/primarycensored that referenced this pull request Dec 11, 2024
seabbs pushed a commit that referenced this pull request Dec 11, 2024
* Revert "177: use `num_elements` instead of `size` (#178)"

This reverts commit 2cfa802.

* assign sizes to variables

* rename variables to match data
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.

Can't compile models on a M3 Macbook Pro
3 participants