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

Add reporter module #227

Merged
merged 9 commits into from
Aug 19, 2018
Merged

Add reporter module #227

merged 9 commits into from
Aug 19, 2018

Conversation

ljvmiranda921
Copy link
Owner

@ljvmiranda921 ljvmiranda921 commented Aug 16, 2018

Description

Adds a new module, reporter, that handles all logging and printing actions. I also added a fancy progress bar c/o tqdm (also part of Reporter methods).

Related Issue

Resolves: #209

Motivation and Context

The console_utils module is severely outdated and needs refactoring. It's also better to separate the concern of logging and printing from the SwarmOptimizer modules. Just get a Reporter instance, and pass all necessary arguments.

How Has This Been Tested?

No new tests, but it passes current test cases in tests/

Types of changes

  • Bug fix (a non-breaking change which fixes an issue)
  • New feature (a non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests pass.

Demonstration:

In a REPL:
sample

In a Jupyter notebook cell:
sample1

@ljvmiranda921 ljvmiranda921 added enhancement Feature requests v.1.1.0 In pipeline for next version labels Aug 16, 2018
@ljvmiranda921 ljvmiranda921 self-assigned this Aug 16, 2018
This commit adds a reporter module that implements a Reporter class.
Its goal is to separate the concern of logging and printing from the
optimizer classes.

Signed-off-by: Lester James V. Miranda <[email protected]>
@whzup
Copy link
Collaborator

whzup commented Aug 18, 2018

This looks pretty cool! Does this also work with IDLE? The print functions harshly effected its speed whenever I used a higher verbosity level.

@ljvmiranda921 ljvmiranda921 mentioned this pull request Aug 18, 2018
9 tasks
@ljvmiranda921
Copy link
Owner Author

Does this also work with IDLE?

Yup!

@ljvmiranda921 ljvmiranda921 changed the title [WIP] Add reporter module Add reporter module Aug 18, 2018
Copy link
Collaborator

@whzup whzup left a comment

Choose a reason for hiding this comment

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

Looking good to me! Although, I have no idea about the package 😄

@ljvmiranda921 ljvmiranda921 merged commit 0ad254d into development Aug 19, 2018
@ljvmiranda921 ljvmiranda921 deleted the add-reporter-module branch August 19, 2018 13:35
@ljvmiranda921 ljvmiranda921 mentioned this pull request Jan 29, 2019
ljvmiranda921 added a commit that referenced this pull request Jan 29, 2019
Resolves #209 

This commit adds a reporter module that implements a Reporter class.
Its goal is to separate the concern of logging and printing from the
optimizer classes.

Signed-off-by: Lester James V. Miranda <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Feature requests v.1.1.0 In pipeline for next version
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants