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

validating class instantiation and jitting #37

Open
ismael-mendoza opened this issue May 5, 2023 · 1 comment
Open

validating class instantiation and jitting #37

ismael-mendoza opened this issue May 5, 2023 · 1 comment
Labels
JAX An issue that involves a pure JAX question

Comments

@ismael-mendoza
Copy link
Collaborator

ismael-mendoza commented May 5, 2023

In many classes in Galsim there is code that validates the instantiation of a class object. This is difficult to maintain if we want make the class jittable and vmappable. For instance, in the Bounds class we had to get rid of code from Galsim that did the following:

        if (self.xmin != int(self.xmin) or self.xmax != int(self.xmax) or
            self.ymin != int(self.ymin) or self.ymax != int(self.ymax)):
            raise TypeError("BoundsI must be initialized with integer values")

I don't think it's urgent but I would like to discuss whether there is a workaround around this that we can use to bring us closer to the Galsim code since these checks are arguably useful for the user.

@jecampagne did you have some ideas regarding this issue?

@ismael-mendoza ismael-mendoza added the JAX An issue that involves a pure JAX question label May 5, 2023
@jecampagne
Copy link
Collaborator

jecampagne commented May 6, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
JAX An issue that involves a pure JAX question
Projects
None yet
Development

No branches or pull requests

2 participants