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

create_interface_for_attributes_920 #1

Open
wants to merge 16 commits into
base: master
Choose a base branch
from

Conversation

J007X
Copy link
Owner

@J007X J007X commented Feb 14, 2023

This PR fixes asyml#920.

Description of changes

(In this phase-1), interface methods are added to the "Data_Store" level to provide basic services that expand the previous methods by allowing batch-like, range selection of atrributes from one or more entries (such as with one or more tids, required type).

Possible influences of this PR.

This could provide a new attribute based interface without the cost of packing and unpacking into classes for quicker attribute access (such as for entries).

Test Conducted

Corresponding unit test is created.

J007X and others added 16 commits February 14, 2023 16:18
…s at Data_Store level (3 methods added, and corresponding unit test codes
* Update README.md

* Update ontology_code_generator.py

* remove type ignore

* fix black

* fix protobuf version

* change versions

* Update README.md
…920' into create_interface_for_attributes_920
…syml#925)

* After related test/tracing code were added to determine details related exception (including statistics comparison with earlier code). The data shows the newly added exception handling code impact the performance most while the difference in dictionary access is insignificant so only the exception handling code is changed.

* fixed black formatting issue

* (test) fixing CI mypy issue (1.7.1 +pyrhon 3.9) of "Unused" comment
…syml#919)

* Initial commit for the performance change relating to class loadind in new code after underline changes related to data pack. After discussed with Hector using standard LRU_Cache instead of custom cache.

* Option 2 for considering dynamic type list as mentioned in asyml#765: created an non-cached version of get_class (get_class_nc) and used in get_class to avoid dynamic list issue as mentioned in comments of asyml#765 as pointed out my Hector.

* Fixed related method sequence issue and added doc

* made lru_cache compatible with Python 3.7

* using full_class_name instead of class_name in get_class_nc

* fixed black format issue

* fixed lint format issue (import sequence)

* fixed for lint issue (import grouping)

* Fix CI warning (in ontology)

* Fix "unhashable key type issue" when using LRU cache for get_class that have optional list as parameter -- change to cache lower level result from "locate" method called in this method, and also provide a non-cached version (same as before) for resolving asyml#765.

* Fix comments on duplicate code of "get_class" and "get_class_nc" by re-factoring into one method with "cached_lookup" optional flag -- by default this is true but in _get_sub_class this flag needs to set to "false" based on comments in asyml#765 (for dynamic class loading scenario).

* Need to remove the old "get_class_nc" signature removed in refactoring

---------

Co-authored-by: Hector <hunterhector@gmail.com>
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.

Create interface (such as for Entry) to extract attributes (especially in massive settings) directly
3 participants