Skip to content

[Tiny & Simple Change] Example classes should be static #2548

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

Merged
merged 1 commit into from
Feb 14, 2019

Conversation

wschin
Copy link
Member

@wschin wschin commented Feb 14, 2019

Polish DYNAMIC examples to fix #2549. This change is inspired by @TomFinley's good comment to #2506 and I sincerely want to address that.

  • Example class should be static
  • Example function should be called Example()
  • Remove redundant using statements.

Please note that this PR only focuses on dynamic examples' static problem. I don't have much bandwidth to take care other cases.

@wschin wschin added the enhancement New feature or request label Feb 14, 2019
@wschin wschin self-assigned this Feb 14, 2019
@wschin wschin changed the title Example classes should be static [Tiny & Simple Change] Example classes should be static Feb 14, 2019
@codecov
Copy link

codecov bot commented Feb 14, 2019

Codecov Report

Merging #2548 into master will decrease coverage by 0.01%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##           master    #2548      +/-   ##
==========================================
- Coverage   71.35%   71.34%   -0.02%     
==========================================
  Files         799      799              
  Lines      141496   141496              
  Branches    16120    16120              
==========================================
- Hits       100971   100946      -25     
- Misses      36062    36088      +26     
+ Partials     4463     4462       -1
Flag Coverage Δ
#Debug 71.34% <ø> (-0.02%) ⬇️
#production 67.66% <ø> (-0.03%) ⬇️
#test 85.4% <ø> (ø) ⬆️

@@ -6,12 +6,12 @@

namespace Microsoft.ML.Samples.Dynamic
{
class OnnxTransformExample
public static class OnnxTransformExample
Copy link
Member

Choose a reason for hiding this comment

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

(nit) you've dropped the Example suffix in other places, but not here.

Copy link
Member

@eerhardt eerhardt left a comment

Choose a reason for hiding this comment

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

:shipit:

@@ -5,7 +5,7 @@

namespace Microsoft.ML.Samples.Dynamic
{
public class ValueMappingExample
public static partial class ValueMapping
Copy link
Contributor

Choose a reason for hiding this comment

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

partial [](start = 18, length = 7)

(nit) it doesn't have to be partial

@@ -6,7 +6,7 @@

namespace Microsoft.ML.Samples.Dynamic
{
public partial class TransformSamples
public static partial class TransformSamples
Copy link
Contributor

Choose a reason for hiding this comment

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

TransformSamples [](start = 32, length = 16)

All timeseries example slightly different from our current samples.
They share same class and introduce data classes inside it, instead of using sample utils.
But I'm not sure they transformation to how we see samples should be done in your PR.


namespace Microsoft.ML.Samples.Dynamic
{
public class PriorTrainerSample
public class PriorTrainer
Copy link
Contributor

Choose a reason for hiding this comment

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

PriorTrainer [](start = 17, length = 12)

if you decide to update PR for nit comments, can you move this class and RandomTrainer to BinaryClassification folder? (If you decide to do it, don't forget to update catalog comments which looks on this file)

Copy link
Contributor

@Ivanidzo4ka Ivanidzo4ka left a comment

Choose a reason for hiding this comment

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

:shipit:

@Ivanidzo4ka
Copy link
Contributor

Thank you for doing this @wschin !

@wschin wschin merged commit 70830ed into dotnet:master Feb 14, 2019
@wschin wschin deleted the static-class-examples branch February 14, 2019 18:07
@ghost ghost locked as resolved and limited conversation to collaborators Mar 24, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Example classes should be static
3 participants