Skip to content

Remove Extra Code Comments and unused InternalStreams project #514

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 6 commits into from
Jul 13, 2018
Merged

Remove Extra Code Comments and unused InternalStreams project #514

merged 6 commits into from
Jul 13, 2018

Conversation

dan-drews
Copy link
Contributor

Fixes #513

This is the first go-around at finding extra commented code sitting around. I'll circle back on more when I have a chance.

@@ -201,55 +201,6 @@ public void EntryPointCaching()
Done();
}

//[Fact]
Copy link
Contributor

Choose a reason for hiding this comment

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

Hi @dan-drews thanks for looking at this. One thing I wonder about is, should this be uncommented and turn into a fact-skip? Or is the code just too far gone for that? (I might suspect some of the names may have changed.)

Copy link
Contributor Author

@dan-drews dan-drews Jul 10, 2018

Choose a reason for hiding this comment

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

Thanks @TomFinley I'll take a look. Should my rule of thumb be that if it compiles, I leave it as fact-skip, otherwise I remove it? I could try to see what things are renamed to, but I'm still not super familiar with this project yet

Edit: Upon further review, there are references to a class called Dv1. That appears not to exist anymore.

Copy link
Contributor

Choose a reason for hiding this comment

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

Unfortunately some classes have been renamed in the leadup to the public release a couple months ago. If it's not obvious how to do it, I would prefer that you leave the commented out code there, rather than destroy the test, since I think I know how "reanimate" this test. (E.g., Dv1 I think is DvInt1, etc. etc.) So while the main codebase I think could use with cleaning, something like this I might prefer to review more carefully. Maybe not cut this one?

Copy link
Contributor

Choose a reason for hiding this comment

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

It may be that it's appropriate to remove it, but I'd prefer to do so in a more deliberative way.


In reply to: 201912980 [](ancestors = 201912980)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have re-added those tests, and just left them commented out. I tried to simply change Dv1 to DvInt1, but the parameters are different. I'd rather somebody with a greater understanding of what is going on here dig through it. Thanks for the feedback!

@TomFinley
Copy link
Contributor

            public uint /*ulong*/ /*IntPtr*/ /*NTSTATUS*/ Status;

I think this and the other line are some things we may consider removing.


Refers to: src/Microsoft.ML.InternalStreams/InternalStreams.cs:271 in 8886bd8. [](commit_id = 8886bd8, deletion_comment = False)

@TomFinley
Copy link
Contributor

                Status = 0; //IntPtr.Zero;

As is this.


Refers to: src/Microsoft.ML.InternalStreams/InternalStreams.cs:276 in 8886bd8. [](commit_id = 8886bd8, deletion_comment = False)

@dan-drews dan-drews changed the title WIP Remove Extra Code Comments Remove Extra Code Comments Jul 10, 2018
@dan-drews
Copy link
Contributor Author

Removed WIP tag. I'm sure there are more comments to be removed, but I think this was a pretty good sweep.

_gradient[d2] -= 0.01 * labelDiff;
}
*/
_gradient[d2] -= delta;
Copy link
Contributor

@Ivanidzo4ka Ivanidzo4ka Jul 11, 2018

Choose a reason for hiding this comment

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

                [](start = 43, length = 20)

can you format this file in VS? or at least remove all extra spaces here. #Resolved

@Ivanidzo4ka
Copy link
Contributor

Ivanidzo4ka commented Jul 11, 2018

    private ParameterSet[] TreeOrderedCandidatesSearch(FastForestRegressionPredictor forest, int numOfCandidates, IEnumerable<IRunResult> previousRuns)

Feel free to delete whole function, no one calls it anyway. #Closed


Refers to: src/Microsoft.ML.Sweeper/Algorithms/SmacSweeper.cs:185 in 97290b2. [](commit_id = 97290b2, deletion_comment = False)


[DllImport(NativePath), SuppressUnmanagedCodeSecurity]
public static extern void CalculateGradientAndUpdateNative(float lambdaLinear, float lambdaLatent, float learningRate, int fieldCount, int latentDim, float weight,
int count, int* /*const*/ fieldIndices, int* /*const*/ featureIndices, float* /*const*/ featureValues, float* /*const*/ latentSum, float slope,
int count, int* fieldIndices, int* featureIndices, float* featureValues, float* latentSum, float slope,
Copy link
Contributor

@Ivanidzo4ka Ivanidzo4ka Jul 11, 2018

Choose a reason for hiding this comment

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

#383 (comment)
See @wschin comment.
I agree this is not the best solution, but I would prefer to preserve this information until we figure out better one.
Same states for Thunk.cs.

We have them for a reason.
#Resolved

@Ivanidzo4ka
Copy link
Contributor

Thank you for your work @dan-drews !
Can we slightly change name of this PR to address removal of InternalStreams project?

@dan-drews dan-drews changed the title Remove Extra Code Comments Remove Extra Code Comments and unused InternalStreams project Jul 11, 2018
@@ -36,8 +36,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.ML.Tests", "test\
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.ML.TestFramework", "test\Microsoft.ML.TestFramework\Microsoft.ML.TestFramework.csproj", "{B5989C06-4FFA-46C1-9D85-9366B34AB0A2}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.ML.InternalStreams", "src\Microsoft.ML.InternalStreams\Microsoft.ML.InternalStreams.csproj", "{C4F7938F-7109-43C8-92A5-9BE47C7FF7D9}"
Copy link
Contributor

Choose a reason for hiding this comment

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

🎆 🍾 😆 Good riddance!!

// return SoftMax(inputs[0], inputs[1]);
//}


Copy link
Contributor

Choose a reason for hiding this comment

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

Blank line with space on it introduced.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is the blank line okay as long as the whitespace is removed?That matches the if statement above.

Also, for my own reference, how can you tell there is whitespace? Is it through Visual Studio? Or is there also a way to know through github?

@@ -600,63 +551,6 @@ public void EntryPointExecGraphCommand()
cmd.Run();
}

//[Fact]
//public void EntryPointArrayOfVariables()
Copy link
Contributor

Choose a reason for hiding this comment

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

//public void EntryPointArrayOfVariables() [](start = 8, length = 42)

Similar with this.

@shauheen shauheen requested a review from codemzs July 12, 2018 09:39
@dan-drews dan-drews changed the title Remove Extra Code Comments and unused InternalStreams project [WIP] Remove Extra Code Comments and unused InternalStreams project Jul 13, 2018
@dan-drews dan-drews changed the title [WIP] Remove Extra Code Comments and unused InternalStreams project Remove Extra Code Comments and unused InternalStreams project Jul 13, 2018
Copy link
Contributor

@TomFinley TomFinley left a comment

Choose a reason for hiding this comment

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

Thanks @dan-drews ! I think the builds are failing due to #428 commit, but once #527 goes in we can request a rebuild...

@Ivanidzo4ka
Copy link
Contributor

@dotnet-bot test Windows_NT Debug
@dotnet-bot test Windows_NT Release
@dotnet-bot test OSX10.13 Debug
@dotnet-bot test OSX10.13 Release
@dotnet-bot test Linux Debug
@dotnet-bot test Linux Release

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 Ivanidzo4ka merged commit 669f4fa into dotnet:master Jul 13, 2018
eerhardt pushed a commit to eerhardt/machinelearning that referenced this pull request Jul 27, 2018
…#514)

* First attempt at removing extra code comments

* Round #2

* Removing Microsoft.ML.InternalStreams per comment on dotnet#513

* Address notes from @Ivanidzo4ka

* Remove TreeOrderedCandidatesSearch

* Remove whitespace and reinstate commented out tests
@ghost ghost locked as resolved and limited conversation to collaborators Mar 30, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants