Skip to content

I want to check what goes into a pull request for sumpy#197

Closed
hirish99 wants to merge 3 commits intoinducer:mainfrom
hirish99:main
Closed

I want to check what goes into a pull request for sumpy#197
hirish99 wants to merge 3 commits intoinducer:mainfrom
hirish99:main

Conversation

@hirish99
Copy link
Copy Markdown
Contributor

Added a simple class called recurrence that takes in a sumpy PDE and outputs a recurrence relation. However the class is not completely unit-tested or even complete in functionality.

@inducer
Copy link
Copy Markdown
Owner

inducer commented May 21, 2024

Thanks! Could you find a typo somewhere and submit a (separate) PR to fix it? That way, I won't have to approve your PR CI runs one-by-one.

Comment on lines +2 to +3
Copyright (C) 2024 Andreas Kloeckner
Copyright (C) 2024 Hirish Chandrasekaran
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Your copyright goes first, you're the main author here.

Comment on lines +45 to +46
def make_sympy_vec(name, n):
return make_obj_array([sp.Symbol(f"{name}{i}") for i in range(n)])
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

This already exists in sumpy.symbolic. Import from there.

from pytools.obj_array import make_obj_array


__doc__ = """
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Make sure this is included in the main documentation somewhere, via

.. automodule:: sumpy.recurrence

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I don't understand, do I add this line to the doc string?

'''
get_pde_in_recurrence_form
Input:
- pde a LinearPDESystemOperator such that assert(len(pde.eqs) == 1) is true.
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Make sure to use proper references here, e.g.

:class:`sumpy.expansion.diff_op.LinearSystemPDEOperator`

def make_sympy_vec(name, n):
return make_obj_array([sp.Symbol(f"{name}{i}") for i in range(n)])

class Recurrence:
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Is there a good reason this should be a class? (vs. just a function)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I think so. Right now the code is structured so that you have a sequence of functions where the output of one function goes into the input of another function. There are intermediate representations that I am interested in like the ODE form of the PDE. If I create a recurrence class then I can store all the intermediate representations as attributes and get them immediately if I am interested in them.

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.

2 participants