stan-dev / stan-dev/math

map_rect with fixed integer and real data across shards

Open
#1,494 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature
Dominant language
C++
Stars
839
Forks
220
Avg merge
2d 4h
Merged PRs (30d)
14

Description

Description

Currently the integer and real data vary by shard in calls to map_rect. In some situations, there is fixed integer or real data per shard. Adding extra arguments for those would allow them to be shared.

This request is transcribed from this forum post by Robert Kubinec, the body of which is:

I have a proposal for what I hope would be a small change to the map_rect function, which I have come to use a lot. Currently the function takes an array of integers, an array of reals, each varying by shard, an array of shard-varying parameters and a vector of non-varying parameters.

What would be really great is a vector of non-varying integers. The reason is because with more complicated models, a number of parameters need to be passed to the function to determine what kind of model to run, etc. While it is possible to append these on to the varying integer, the code would be much cleaner/logical with a separate vector.

Example

map_rect(...., data int[] fixed_i, data real[] fixed_r)

Current Version:

v3.0.0

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the current map_rect entry point and how its shard-varying integer and real arguments are handled. Done means map_rect supports fixed integer and real data shared across shards, matching the proposed argument shape in the example.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
backend-api-design
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.