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

Unify responsibleai constants #1925

Merged
merged 7 commits into from
Jan 27, 2023
Merged

Conversation

romanlutz
Copy link
Contributor

Description

This is a prerequisite to adding RAIForecastingInsights in the next PR. Having everything on a per-file basis was not very clean, so I decided to unify them

Checklist

  • I have added screenshots above for all UI changes.
  • I have added e2e tests for all UI changes.
  • Documentation was updated if it was needed.

@codecov-commenter
Copy link

codecov-commenter commented Jan 27, 2023

Codecov Report

Merging #1925 (8ffc6d2) into main (695d87c) will decrease coverage by 28.53%.
The diff coverage is n/a.

@@             Coverage Diff             @@
##             main    #1925       +/-   ##
===========================================
- Coverage   92.44%   63.92%   -28.53%     
===========================================
  Files         103       13       -90     
  Lines        4871      158     -4713     
===========================================
- Hits         4503      101     -4402     
+ Misses        368       57      -311     
Flag Coverage Δ
unittests 63.92% <ø> (-28.53%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
responsibleai/responsibleai/_internal/constants.py
...bleai/responsibleai/_tools/causal/causal_result.py
...onsibleai/_tools/shared/attribute_serialization.py
...i/responsibleai/managers/counterfactual_manager.py
...eai/responsibleai/managers/data_balance_manager.py
...i/responsibleai/managers/error_analysis_manager.py
...ibleai/responsibleai/managers/explainer_manager.py
...ai/responsibleai/rai_insights/rai_base_insights.py
...sibleai/responsibleai/rai_insights/rai_insights.py
responsibleai/responsibleai/_tools/__init__.py
... and 80 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

1 similar comment
@romanlutz romanlutz force-pushed the romanlutz/refactor_rai_insights branch from 94b14db to a9614e1 Compare January 27, 2023 15:00
1 similar comment
@romanlutz romanlutz enabled auto-merge (squash) January 27, 2023 16:49
@romanlutz romanlutz merged commit 86af032 into main Jan 27, 2023
@romanlutz romanlutz deleted the romanlutz/refactor_rai_insights branch January 27, 2023 18:12
@@ -198,7 +199,8 @@ def test_loading_rai_insights_without_model_file(self):

# Remove the model.pkl file to cause an exception to occur
# while loading the model.
model_pkl_path = Path(tmpdir) / "rai_insights" / "model.pkl"
model_pkl_path = Path(tmpdir) / \
"rai_insights" / SerializationAttributes.MODEL_PKL
Copy link
Contributor

Choose a reason for hiding this comment

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

should this also be a const?

explainer_pkl_path = \
directory_manager.get_generators_directory() / "explainer.pkl"
explainer_pkl_path = (
directory_manager.get_generators_directory() /
Copy link
Contributor

Choose a reason for hiding this comment

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

and this one

@@ -60,7 +61,7 @@ def test_causal_save_and_load(self, housing_data, tmpdir):
dm = DirectoryManager(parent_directory_path=save_dir,
sub_directory_name=causal_dir)
causal_analysis_pkl_file_path = \
dm.get_data_directory() / "causal_analysis.pkl"
dm.get_data_directory() / ("causal_analysis" + FileFormats.PKL)
Copy link
Contributor

Choose a reason for hiding this comment

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

Oh I see, you are moving common ones in a file. These could be a const in their own file. May be not for this PR.

RubyZ10 pushed a commit that referenced this pull request Feb 7, 2023
* use META_JSON directly instead of declaring a variable

* move constants to common files and reuse

* lowercase f

* isort

* use parentheses instead of backslashes

* flake8

* isort

Signed-off-by: RubyZ10 <zhenzhu@microsoft.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.

4 participants