Animacy has come up in a few recent questions, especially in comparison to gender. One interesting thing that turned up in the comments on those questions was whether or not animacy can sometimes be purely grammatical.
Let me compare with gender which is more familiar.
Natural gender and grammatical gender are two different things.
Natural gender is not abstract or arbitrarily assigned. This is when language reflects the sex of things, mostly people and higher animals. English has natural gender in pronouns etc: "he", "she", "him", "her", "his". Some languages have only one third person pronoun regardless of the sex of the person etc referred to.
Natural gender is not lexical. It refers directly to the sex of the thing referred to and not the word representing the thing.
Grammatical gender is abstract or arbitrarily assigned. This is when every word is assigned a class such as "masculine", "feminine", "neuter", "common". These assignments are mostly not related to sex but may be related to the sound of the word or may be utterly arbitrary. Words for inanimate objects are very often assigned to the "masculine" or "feminine" class and animate objects are sometimes assigned to the "neuter" (sexless) class, for example German "Fräulein" is a neuter word for "girl", not feminine as would be expected under natural gender.
Grammatical gender is lexical. It refers to the word representing the thing and not to the thing directly. Two synonyms referring to the same thing rrcan have different genders. For example there are two Spanish words for "star". "El astro" is masculine and "La estrella" is feminine.
It helps to differentiate the words "gender" and "sex" when talking about this topic. "Gender" was originally a grammatical term only and came to become a synonym for sex later.
There is another phenomenon often confused with grammatical gender. I might call it "semantic gender" but there's probably a real term for it. In English all ships tend to be referred to as "her", but this is not lexical, does not depend on the word used for the ship. Languages with grammatical gender may use different genders for "schooner", "destroyer", "carrier", and "battleship".
So, is animacy ever in any language grammatical? That is to say does it have the properties of being a) abstract/arbitrarily assigned and b) lexical?