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

Include Poynting Vector calculation #7

Merged
merged 1 commit into from
Jan 22, 2023
Merged

Conversation

jan-david-fischbach
Copy link
Collaborator

to avoid recalculation caching in private attributes is used.
It uses pydantic.PrivateAttr to conform to pydantic. I am not sure, that this is a beautiful way to do it. It should not be saved when serializing/deserializing.
Addresses task 1 of #6.

I had to move jaxlib to conda/mamba install and remove klujax from the environment.yml, because it doesn't install properly on macos at the moment. A pull request to fix the problem is open here flaport/klujax#1.

to avoid recalculation caching
in private attributes is used.
It uses `pydantic.PrivateAttr` to conform to pydantic.
I am not sure, that this is a beautiful way to do it.
It should not be saved when serializing/deserializing.
@flaport
Copy link
Owner

flaport commented Jan 22, 2023

Hi @Jan-David-Black ,

Cool, I was not aware of pydantic.PrivateAttr! I'll look into using it in the future too.

In general, so far I am not very happy with Pydantic, it forces you in a mold and anything slightly outside its default usecases (like adding private attributes, in combination with keeping json serializability) turn out to be a complete pain. In for example cell.py I'm using an 'extra' field, which is then excluded from the json schema in the Config class, but I'm not particularly happy with that solution either, but it seems to work for now.

In any case... pydantic seems to be the de-facto standard now for dataclasses and I still like it for parsing stuff so I'll probably stick to it.

Your PR looks good. Merging :)

@flaport flaport merged commit 669dbda into flaport:main Jan 22, 2023
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.

None yet

2 participants