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

Custom profile #20

Merged
merged 16 commits into from
Oct 11, 2023
Merged

Custom profile #20

merged 16 commits into from
Oct 11, 2023

Conversation

guillaume-alliander
Copy link
Collaborator

  • Add clean custom profile via the BaseProfile class
  • document use of customprofile
  • reorganise Base.py which had a lot of things into a utils package and neatly separated modules.
  • piggyback: remove all imports from init - it shaves 4s on start, thanks to not having to load all resources in memory
  • piggyback: unit test to check the syntax/validity of all resources

Copy link
Contributor

@chicco785 chicco785 left a comment

Choose a reason for hiding this comment

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

I am not sure how namespaces are handled for the profiles and hence for the custom classes.

My assumption is that if I create a custom class, I should be able to define it's namespace. Then any attribute attached (if not specified otherwise), should use that namespace as default.

README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
```python
from pycgmes.utils.profile import BaseProfile

class CustomProfile(BaseProfile):
Copy link
Contributor

Choose a reason for hiding this comment

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

I have been thinking about this (e.g. using string enums for profiles), in general I think this a bit a workaround currently, since they are used to define the short name of the profile, which is in general "arbitrary", while what matters from a semantic point of view is the fullname defined via the namespace.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

You are totally correct! I will look into that.

README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
examples/custom_attributes.py Show resolved Hide resolved
@guillaume-alliander guillaume-alliander force-pushed the custom_profile branch 2 times, most recently from 0b124b7 to 887bfba Compare October 6, 2023 15:58
pycgmes/utils/base.py Outdated Show resolved Hide resolved
Copy link
Contributor

@chicco785 chicco785 left a comment

Choose a reason for hiding this comment

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

LGTM

Signed-off-by: Guillaume Roger <guillaume.roger@alliander.com>
Signed-off-by: Guillaume Roger <guillaume.roger@alliander.com>
Signed-off-by: Guillaume Roger <guillaume.roger@alliander.com>
Signed-off-by: Guillaume Roger <guillaume.roger@alliander.com>
Signed-off-by: Guillaume Roger <guillaume.roger@alliander.com>
Signed-off-by: Guillaume Roger <guillaume.roger@alliander.com>
Signed-off-by: Guillaume Roger <guillaume.roger@alliander.com>
Signed-off-by: Guillaume Roger <guillaume.roger@alliander.com>
Signed-off-by: Guillaume Roger <guillaume.roger@alliander.com>
Signed-off-by: Guillaume Roger <guillaume.roger@alliander.com>
Signed-off-by: Guillaume Roger <guillaume.roger@alliander.com>
…, to be dealt with elsewhere.

Signed-off-by: Guillaume Roger <guillaume.roger@alliander.com>
Signed-off-by: Guillaume Roger <guillaume.roger@alliander.com>
robinklaassen and others added 3 commits October 11, 2023 16:37
Signed-off-by: Robin Klaassen <robin.klaassen@alliander.com>
Signed-off-by: Robin Klaassen <robin.klaassen@alliander.com>
Signed-off-by: Guillaume Roger <guillaume.roger@alliander.com>

- [cgmes-python](#cgmes-python)
<<<<<<< HEAD
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
<<<<<<< HEAD

- [V3 source zip](#v3-source-zip)
- [Dataclasses](#dataclasses)
- [Library build, CI, CD...](#library-build-ci-cd)
- [CI](#ci)
- [CD](#cd)
- [License](#license)
>>>>>>> 4384d02 (update docs with CGMES info)
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
>>>>>>> 4384d02 (update docs with CGMES info)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

🤦‍♂️

@guillaume-alliander guillaume-alliander merged commit 7b3d449 into main Oct 11, 2023
2 checks passed
@guillaume-alliander guillaume-alliander deleted the custom_profile branch October 11, 2023 14:38
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.

3 participants