-
Notifications
You must be signed in to change notification settings - Fork 32
data wrangler updates #1171
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
base: master
Are you sure you want to change the base?
data wrangler updates #1171
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -204,19 +204,20 @@ def quantidic(ilvl, wrangler): | |
| pl = wrangler.getPatchLevel(ilvl) | ||
|
|
||
| return { | ||
| "density": pl.getDensity, | ||
| "bulkVelocity_x": pl.getVix, | ||
| "bulkVelocity_y": pl.getViy, | ||
| "bulkVelocity_z": pl.getViz, | ||
| "EM_B_x": pl.getBx, | ||
| "EM_B_y": pl.getBy, | ||
| "EM_B_z": pl.getBz, | ||
| "EM_E_x": pl.getEx, | ||
| "EM_E_y": pl.getEy, | ||
| "EM_E_z": pl.getEz, | ||
| "flux_x": pl.getFx, | ||
| "flux_y": pl.getFy, | ||
| "flux_z": pl.getFz, | ||
| "density": pl.getNi, | ||
| "Vi": pl.getVi, | ||
| "EM_B_x": lambda: pl.getB("x"), | ||
| "EM_B_y": lambda: pl.getB("y"), | ||
| "EM_B_z": lambda: pl.getB("z"), | ||
| "EM_E_x": lambda: pl.getE("x"), | ||
| "EM_E_y": lambda: pl.getE("y"), | ||
| "EM_E_z": lambda: pl.getE("z"), | ||
| "bulkVelocity_x": lambda: pl.getVi("x"), | ||
| "bulkVelocity_y": lambda: pl.getVi("y"), | ||
| "bulkVelocity_z": lambda: pl.getVi("z"), | ||
| "flux_x": lambda pop: pl.getFlux("x", pop), | ||
| "flux_y": lambda pop: pl.getFlux("y", pop), | ||
| "flux_z": lambda pop: pl.getFlux("z", pop), | ||
|
Comment on lines
+218
to
+220
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Keep the flux getters compatible with the field-quantity call path.
🤖 Prompt for AI Agents |
||
| "particles": pl.getParticles, | ||
| } | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -37,8 +37,15 @@ def __str__(self): | |
| def __repr__(self): | ||
| return self.__str__() | ||
|
|
||
| def __iter__(self): | ||
| return self.patch_datas.items().__iter__() | ||
|
|
||
| def __getitem__(self, key): | ||
| return self.patch_datas[key] | ||
| try: | ||
| return self.patch_datas[key] | ||
| except KeyError as e: | ||
| print(key, "not in", self.patch_datas.keys()) | ||
| raise e | ||
|
Comment on lines
+44
to
+48
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: find . -name "patch.py" -path "*/hierarchy/*" | head -5Repository: PHAREHUB/PHARE Length of output: 103 🏁 Script executed: sed -n '40,55p' ./pyphare/pyphare/pharesee/hierarchy/patch.pyRepository: PHAREHUB/PHARE Length of output: 484 Use bare In this except KeyError as e:
print(key, "not in", self.patch_datas.keys())
raise🧰 Tools🪛 Ruff (0.15.4)[warning] 48-48: Use Remove exception name (TRY201) 🤖 Prompt for AI Agents |
||
|
|
||
| def copy(self): | ||
| """does not copy patchdatas.datasets (see class PatchData)""" | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,15 +1,27 @@ | ||
| # | ||
| # | ||
| # | ||
|
|
||
|
|
||
| class PatchLevel: | ||
| """is a collection of patches""" | ||
|
|
||
| def __init__(self, lvl_nbr, patches): | ||
| self.level_number = lvl_nbr | ||
| self.patches = patches | ||
|
|
||
| def __iter__(self): | ||
| return self.patches.__iter__() | ||
|
|
||
| def level_range(self): | ||
| name = list(self.patches[0].patch_datas.keys())[0] | ||
| return min([patch.patch_datas[name].x.min() for patch in self.patches]), max( | ||
| [patch.patch_datas[name].x.max() for patch in self.patches] | ||
| ) | ||
|
|
||
| def __getitem__(self, idx): | ||
| return self.patches[idx] | ||
|
|
||
| def __iter__(self): | ||
| return self.patches.__iter__() | ||
|
|
||
| @property | ||
| def cell_width(self): | ||
| return self.patches[0].layout.dl | ||
|
PhilipDeegan marked this conversation as resolved.
|
||
Uh oh!
There was an error while loading. Please reload this page.