Giter Site home page Giter Site logo

Comments (12)

bourgesl avatar bourgesl commented on July 17, 2024

It looks strange !

The expression "FitsConstants.KEYWORD_CONTENT_OIFITS2.equals(FitsConstants.KEYWORD_CONTENT) ? OIFitsStandard.VERSION_2 : OIFitsStandard.VERSION_1)" is CONSTANT !

C1.equals(C2) ? V1 : V2 => V1 or V2 !

Please verify the use cases.

You would need instead:
public OIFitsStandard getOIFitsStandard(String content) {
return (FitsConstants.KEYWORD_CONTENT_OIFITS2.equals(content) ? OIFitsStandard.VERSION_2 : OIFitsStandard.VERSION_1);
}

from oitools.

Hitogoroshi avatar Hitogoroshi commented on July 17, 2024

Right.
Last problem is where to place the method.
We have a use like this when oifitsfile does not exist yet.

from oitools.

bourgesl avatar bourgesl commented on July 17, 2024

Make a static public method in the appropriate class ...

"We have a use like this when oifitsfile does not exist yet."
Alright, what is your proposal ?

from oitools.

Hitogoroshi avatar Hitogoroshi commented on July 17, 2024

In OIFITSFILE:
use : (FitsConstants.KEYWORD_CONTENT_OIFITS2.equals(FitsConstants.KEYWORD_CONTENT) ? OIFitsStandard.VERSION_2 : OIFitsStandard.VERSION_1) to define version. (2 times)

In OIFITSLOADER:
use: (FitsConstants.KEYWORD_CONTENT_OIFITS2.equals(content) ? OIFitsStandard.VERSION_2 : OIFitsStandard.VERSION_1) to define version of OIFITS
with content = header.getTrimmedStringValue(FitsConstants.KEYWORD_CONTENT) ( 2 times)

from oitools.

bourgesl avatar bourgesl commented on July 17, 2024

Check & verify the OIFITSFILE as it looks buggy !

from oitools.

Hitogoroshi avatar Hitogoroshi commented on July 17, 2024

We have in OiFitsFile a comparison with constants (used two times):

(FitsConstants.KEYWORD_CONTENT_OIFITS2.equals(FitsConstants.KEYWORD_CONTENT) ? OIFitsStandard.VERSION_2 : OIFitsStandard.VERSION_1)

We need to check its effect

Proposal:
Can delete the method : checker.inspectRuleFailed() (Special case which catch the failures using directly the applyTo and version information)

To

checker.ruleFailed(Rule.OIFITS_OI_TARGET_EXIST);
which now can process rules begin with OIFITS (And add "FILE" in the applyTo for this rules).

from oitools.

Hitogoroshi avatar Hitogoroshi commented on July 17, 2024

Question related to the review of the method:
inspectRuleFailed(final Rule rule, final String applyTo, final OIFitsStandard standard)

Maybe new issue

from oitools.

bourgesl avatar bourgesl commented on July 17, 2024

I still do not understand anything...

from oitools.

gmella avatar gmella commented on July 17, 2024

Yes, what is the question related to the review of the method ?

from oitools.

Hitogoroshi avatar Hitogoroshi commented on July 17, 2024

Create Method to define version of the File in OIFitsFile done:
getOIFitsStandard(content)

from oitools.

bourgesl avatar bourgesl commented on July 17, 2024

still waiting for patch

from oitools.

bourgesl avatar bourgesl commented on July 17, 2024

Fix pushed

from oitools.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.