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

Disable nifgen get_fir_filter_coefficients() #891

Merged
merged 13 commits into from
Jun 8, 2018

Conversation

texasaggie97-zz
Copy link
Contributor

@texasaggie97-zz texasaggie97-zz commented Jun 5, 2018

  • This contribution adheres to CONTRIBUTING.md.
  • I've updated CHANGELOG.md if applicable.
  • I've added tests applicable for this pull request

What does this Pull Request accomplish?

  • Remove get_fir_filter_coefficients() because it only applies for OSP and OSP is not included in the Python API yet in general
  • Keep all created files and metadata in case we need to enable again in the future
    • Don't want to have to figure this out again.
  • Fixed nifgen get_fir_filter_coefficients()
    • Create specific implementation instead of relying on code generator
      • Not really ivi-dance because the size is returned in an out parameter instead of the return value (error)
      • Not worth trying to make the code generator support this use case for this one function
    • Don't use code generator for documentation

List issues fixed by this Pull Request below, if any.

What testing has been done?

  • Unit
  • System
  • Visual inspection of generated files

@texasaggie97-zz texasaggie97-zz changed the title Bug596/get fir filter coefficients Fix nifgen get_fir_filter_coefficients() Jun 5, 2018

.. py:class:: Session(self, resource_name, channel_name=None, reset_device=False, options={})

==============
Copy link
Member

Choose a reason for hiding this comment

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

Why is all this noise in the diff? Something about line endings got messed up?

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 am not sure. Looking into it but I don't see anything obvious


| Returns the FIR filter coefficients used by the onboard signal
processing block. These coefficients are determined by NI-FGEN and
based on the FIR filter type and corresponding property (Alpha,
Copy link
Member

Choose a reason for hiding this comment

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

Since we have control over this text now, we could type the actual property name so they get linked).

@@ -105,8 +105,6 @@ def __init__(self):
self._defaults['GetExtCalRecommendedInterval']['Months'] = None
self._defaults['GetFIRFilterCoefficients'] = {}
self._defaults['GetFIRFilterCoefficients']['return'] = 0
self._defaults['GetFIRFilterCoefficients']['numberOfCoefficientsRead'] = None
Copy link
Member

Choose a reason for hiding this comment

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

If this mocks the C function, why did it change at all?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Because I cleaned up (I.e. removed) the overrides we had in functions_addon. So directions changed.

coeff_array = [1, 0, -1]
coeff_array = [0 for i in range(95)]
coeff_array[0] = -1.0
coeff_array[2] = 1.0
Copy link
Member

Choose a reason for hiding this comment

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

This should error because the device expected symmetrical coefficients.
I think you need to also enable OSP so that the OSP configuration gets validated.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Test disabled since OSP disabled, can't check this.

@texasaggie97-zz texasaggie97-zz changed the title Fix nifgen get_fir_filter_coefficients() Disable nifgen get_fir_filter_coefficients() Jun 7, 2018
@texasaggie97-zz texasaggie97-zz dismissed marcoskirsch’s stale review June 7, 2018 21:14

Disabled function since OSP

@marcoskirsch
Copy link
Member

Do we have an issue about adding OSP to NI-FGEN?
If we don't we should open it and reference all those Issues that are getting closed now but would become a problem again when we start tackling OSP.

@@ -0,0 +1,42 @@
<%page args="function, config, method_template, indent"/>\
Copy link
Member

Choose a reason for hiding this comment

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

Are you keeping these on purpose because they may be useful in the future?
I'm not sure what the proper way of handling this sort of thing is.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, I am keeping this on purpose. I mentioned that in the PR description. I don't want to lose this knowledge since it isn't obvious how this needs to work.

Copy link
Member

Choose a reason for hiding this comment

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

It just seems like dead code so there's a risk of it being removed in the future too.

How about removing it but in the issue recording the last commit that contained it to show a solution?

@texasaggie97-zz
Copy link
Contributor Author

We have an issue about complex datatypes (#189 and #514) and OSP only applies to complex data.

@texasaggie97-zz texasaggie97-zz dismissed marcoskirsch’s stale review June 7, 2018 23:01

Comments addressed?

@marcoskirsch
Copy link
Member

Comments addressed?

I think we should leverage the Git repo, rather than have dead code in master.
This can be done by having a branch with the files (I don't like this idea) or simply documenting in the related issues, even in the test comment, the Git ID where the fix existed.

@texasaggie97-zz
Copy link
Contributor Author

texasaggie97-zz commented Jun 8, 2018 via email

@marcoskirsch
Copy link
Member

What if we commit to master, then remove?
How is this typically done?

@texasaggie97-zz
Copy link
Contributor Author

Add more comments about how these are not used until OSP is supported

@marcoskirsch marcoskirsch merged commit 92734b9 into master Jun 8, 2018
@marcoskirsch marcoskirsch deleted the bug596/get_fir_filter_coefficients branch June 8, 2018 16:46
texasaggie97-zz added a commit that referenced this pull request Jun 18, 2019
marcoskirsch pushed a commit that referenced this pull request Jul 24, 2019
* Remove templates that are no longer required

* Per #891 OSP functions should not be public

* Use ivi-dance-with-a-twist in case ever made public

* Update generated files

* Update CHANGELOG.md
@ni-jfitzger ni-jfitzger mentioned this pull request Nov 7, 2022
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants