-
Notifications
You must be signed in to change notification settings - Fork 16
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
Add flux consumption model from I. Savona #57
Conversation
@IsaacSavona Could you please check if this merge request matches your original implementation? I've marked a few points where I had questions with Also, the Jupyter notebook needs to be ported to the new style. Could you do this? |
I am looking into this now. The only thing I immediately see missing from the commit is the algorithm files, but I guess you have modified this to be Algorithm.register_algorithm structure. |
I looked at the TODO's everything seems good:
I will look into porting the Jupyter notebook to the new style |
Hi guys, Having some trouble porting the new changes to my notebook. I have tried running IssueRunning ErrorIt is too long to warrant pasting the entire thing, but I have attached the very end below. It seems like it has something to do with the key-value pairs of the impurities...
|
Hi Isaac,
Can you run
poetry install
poetry run radas
?
It looks like you’re missing the atomic data files.
Cheers,
Tom
<https://cfs.energy/>
Thomas Body
Scientist, Boundary and Divertor Physics
Commonwealth Fusion Systems <https://cfs.energy/>
he/him/his
…On Mon, 27 May 2024 at 10:14 PM, IsaacSavona ***@***.***> wrote:
@IsaacSavona <https://github.com/IsaacSavona> Could you please check if
this merge request matches your original implementation?
I've marked a few points where I had questions with TODO: please clear
these.
Also, the Jupyter notebook needs to be ported to the new style. Could you
do this?
Hi guys,
Having some trouble porting the new changes to my notebook. I have tried
running getting_started.ipynb to no avail. I get an error at
algorithm.update_dataset(dataset).
Issue
Running algorithm.update_dataset(dataset)
Error
It is too long to warrant pasting the entire thing, but I have attached
the very end below. It seems like it has something to do with the key-value
pairs of the impurities...
...
File [~/Documents/CFS/cfspopcon24/cfspopcon/cfspopcon/algorithm_class.py:119](https://file+.vscode-resource.vscode-cdn.net/Users/isaacsavona/Documents/CFS/cfspopcon24/cfspopcon/docs/doc_sources/~/Documents/CFS/cfspopcon24/cfspopcon/cfspopcon/algorithm_class.py:119), in Algorithm.update_dataset(self, dataset, allow_overwrite)
[114](https://file+.vscode-resource.vscode-cdn.net/Users/isaacsavona/Documents/CFS/cfspopcon24/cfspopcon/docs/doc_sources/~/Documents/CFS/cfspopcon24/cfspopcon/cfspopcon/algorithm_class.py:114) sorted_default_keys = ", ".join(sorted(self.default_keys))
[115](https://file+.vscode-resource.vscode-cdn.net/Users/isaacsavona/Documents/CFS/cfspopcon24/cfspopcon/docs/doc_sources/~/Documents/CFS/cfspopcon24/cfspopcon/cfspopcon/algorithm_class.py:115) raise KeyError(
[116](https://file+.vscode-resource.vscode-cdn.net/Users/isaacsavona/Documents/CFS/cfspopcon24/cfspopcon/docs/doc_sources/~/Documents/CFS/cfspopcon24/cfspopcon/cfspopcon/algorithm_class.py:116) f"KeyError for {self._name}: Key '{key}' not in dataset keys [{sorted_dataset_keys}] or default values [{sorted_default_keys}]"
[117](https://file+.vscode-resource.vscode-cdn.net/Users/isaacsavona/Documents/CFS/cfspopcon24/cfspopcon/docs/doc_sources/~/Documents/CFS/cfspopcon24/cfspopcon/cfspopcon/algorithm_class.py:117) )
--> [119](https://file+.vscode-resource.vscode-cdn.net/Users/isaacsavona/Documents/CFS/cfspopcon24/cfspopcon/docs/doc_sources/~/Documents/CFS/cfspopcon24/cfspopcon/cfspopcon/algorithm_class.py:119) result = self._function(**input_values)
[120](https://file+.vscode-resource.vscode-cdn.net/Users/isaacsavona/Documents/CFS/cfspopcon24/cfspopcon/docs/doc_sources/~/Documents/CFS/cfspopcon24/cfspopcon/cfspopcon/algorithm_class.py:120) return xr.Dataset(result).merge(dataset, join="left", compat=("override" if allow_overwrite else "no_conflicts"))
...
--> [304](https://file+.vscode-resource.vscode-cdn.net/Users/isaacsavona/Documents/CFS/cfspopcon24/cfspopcon/docs/doc_sources/~/Documents/CFS/cfspopcon24/cfspopcon/cfspopcon/formulas/read_atomic_data.py:304) max_temp, min_temp, max_density, min_density = self.grid_limits[species]
[305](https://file+.vscode-resource.vscode-cdn.net/Users/isaacsavona/Documents/CFS/cfspopcon24/cfspopcon/docs/doc_sources/~/Documents/CFS/cfspopcon24/cfspopcon/cfspopcon/formulas/read_atomic_data.py:305) electron_temp = np.minimum(electron_temp, max_temp)
[306](https://file+.vscode-resource.vscode-cdn.net/Users/isaacsavona/Documents/CFS/cfspopcon24/cfspopcon/docs/doc_sources/~/Documents/CFS/cfspopcon24/cfspopcon/cfspopcon/formulas/read_atomic_data.py:306) electron_temp = np.maximum(electron_temp, min_temp)
KeyError: <AtomicSpecies.Helium: 2>
—
Reply to this email directly, view it on GitHub
<#57 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/A32XUMNRBEWHBUCQUCCCLETZEOH2RAVCNFSM6AAAAABH6O7Z3KVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMZUGAYDMOJVG4>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Hi Tom, I have already done these things...
|
18e89bd
to
4ee959b
Compare
Hey @tbody-cfs! I am trying to keep up with your changes. I have updated my notebook and have two questions (there is a preamble to each but the main questions are bolded):
|
ea2b308
to
1da2410
Compare
f2b4b91
to
314d85f
Compare
Hi @IsaacSavona, To update the regression results, you've got the correct command For updating the dataset yourself, I'm not sure if I understand the error that you're encountering. The following shows how you'd calculate all of the terms to run your flux consumption model.
Could you pull the latest changes, update the demo notebook and then push your changes. Then, we'll merge this in. |
I am getting on this now |
* commiting notebook ported to new style * changed notebook to reflect newer style * same as before
Replaces #4
Added inductance functionality and flux functionality to POPCON for time-dependent and time-independent calculations.
Compared to #4
wraps_ufunc
Algorithm.register_algorithm
methodKeeps the same test suite as the original merge request.
N.b. All physics in this merge request was implemented by I. Savona